author | Wolfgang Rosenauer <wr@rosenauer.org> |
Sun, 12 Jun 2022 16:05:04 +0200 | |
branch | firefox101 |
changeset 1174 | 90e3d0cf8567 |
parent 1172 | 7bdeb580be51 |
child 1175 | 4c6576f9cf04 |
permissions | -rw-r--r-- |
1164 | 1 |
# HG changeset patch |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
2 |
# Parent 6d59717f59a1c0dc50140e750d665c7e98de3e66 |
1164 | 3 |
|
1162 | 4 |
diff --git a/Cargo.lock b/Cargo.lock |
5 |
--- a/Cargo.lock |
|
6 |
+++ b/Cargo.lock |
|
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
7 |
@@ -2207,18 +2207,16 @@ name = "glsl-to-cxx" |
1164 | 8 |
version = "0.1.0" |
9 |
dependencies = [ |
|
10 |
"glsl", |
|
11 |
] |
|
12 |
||
1162 | 13 |
[[package]] |
14 |
name = "glslopt" |
|
15 |
version = "0.1.9" |
|
16 |
-source = "registry+https://github.com/rust-lang/crates.io-index" |
|
17 |
-checksum = "74a3f5c04450dfdadb4b08f6e5ee6f5110f674de1acbd6199bfec68392a8cbaf" |
|
18 |
dependencies = [ |
|
19 |
"cc", |
|
20 |
] |
|
1164 | 21 |
|
22 |
[[package]] |
|
1168 | 23 |
name = "gluesmith" |
24 |
version = "0.1.0" |
|
25 |
dependencies = [ |
|
1162 | 26 |
diff --git a/Cargo.toml b/Cargo.toml |
27 |
--- a/Cargo.toml |
|
28 |
+++ b/Cargo.toml |
|
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
29 |
@@ -109,12 +109,13 @@ chardetng = { git = "https://github.com/ |
1164 | 30 |
chardetng_c = { git = "https://github.com/hsivonen/chardetng_c", rev="ed8a4c6f900a90d4dbc1d64b856e61490a1c3570" } |
1171 | 31 |
coremidi = { git = "https://github.com/chris-zen/coremidi.git", rev="fc68464b5445caf111e41f643a2e69ccce0b4f83" } |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
32 |
fog = { path = "toolkit/components/glean/api" } |
1164 | 33 |
libudev-sys = { path = "dom/webauthn/libudev-sys" } |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
34 |
packed_simd = { package = "packed_simd_2", git = "https://github.com/hsivonen/packed_simd", rev="c149d0a519bf878567c7630096737669ec2ff15f" } |
1171 | 35 |
midir = { git = "https://github.com/mozilla/midir.git", rev = "4c11f0ffb5d6a10de4aff40a7b81218b33b94e6f" } |
1164 | 36 |
minidump_writer_linux = { git = "https://github.com/msirringhaus/minidump_writer_linux.git", rev = "029ac0d54b237f27dc7d8d4e51bc0fb076e5e852" } |
1174
90e3d0cf8567
Firefox 101.x release
Wolfgang Rosenauer <wr@rosenauer.org>
parents:
1172
diff
changeset
|
37 |
|
1162 | 38 |
+glslopt = { path = "third_party/rust/glslopt/" } |
1171 | 39 |
# Patch mio 0.6 to use winapi 0.3 and miow 0.3, getting rid of winapi 0.2. |
40 |
# There is not going to be new version of mio 0.6, mio now being >= 0.7.11. |
|
41 |
[patch.crates-io.mio] |
|
42 |
path = "third_party/rust/mio-0.6.23" |
|
1162 | 43 |
diff --git a/gfx/skia/skia/include/codec/SkEncodedOrigin.h b/gfx/skia/skia/include/codec/SkEncodedOrigin.h |
44 |
--- a/gfx/skia/skia/include/codec/SkEncodedOrigin.h |
|
45 |
+++ b/gfx/skia/skia/include/codec/SkEncodedOrigin.h |
|
1164 | 46 |
@@ -36,12 +36,13 @@ static inline SkMatrix SkEncodedOriginTo |
47 |
case kBottomRight_SkEncodedOrigin: return SkMatrix::MakeAll(-1, 0, w, 0, -1, h, 0, 0, 1); |
|
48 |
case kBottomLeft_SkEncodedOrigin: return SkMatrix::MakeAll( 1, 0, 0, 0, -1, h, 0, 0, 1); |
|
49 |
case kLeftTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, 1, 0, 0, 0, 0, 1); |
|
50 |
case kRightTop_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h, 1, 0, 0, 0, 0, 1); |
|
51 |
case kRightBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, -1, h, -1, 0, w, 0, 0, 1); |
|
1162 | 52 |
case kLeftBottom_SkEncodedOrigin: return SkMatrix::MakeAll( 0, 1, 0, -1, 0, w, 0, 0, 1); |
53 |
} |
|
54 |
SK_ABORT("Unexpected origin"); |
|
55 |
+ SkUNREACHABLE; |
|
56 |
} |
|
57 |
||
58 |
||
1164 | 59 |
#endif // SkEncodedOrigin_DEFINED |
1162 | 60 |
diff --git a/gfx/skia/skia/include/private/GrTypesPriv.h b/gfx/skia/skia/include/private/GrTypesPriv.h |
61 |
--- a/gfx/skia/skia/include/private/GrTypesPriv.h |
|
62 |
+++ b/gfx/skia/skia/include/private/GrTypesPriv.h |
|
1164 | 63 |
@@ -535,32 +535,34 @@ static inline GrSLType GrSLCombinedSampl |
64 |
return kTexture2DSampler_GrSLType; |
|
65 |
case GrTextureType::kRectangle: |
|
66 |
return kTexture2DRectSampler_GrSLType; |
|
67 |
case GrTextureType::kExternal: |
|
68 |
return kTextureExternalSampler_GrSLType; |
|
1162 | 69 |
default: |
70 |
SK_ABORT("Unexpected texture type"); |
|
71 |
} |
|
72 |
+ SkUNREACHABLE; |
|
73 |
} |
|
74 |
||
75 |
/** Rectangle and external textures only support the clamp wrap mode and do not support |
|
1164 | 76 |
* MIP maps. |
77 |
*/ |
|
78 |
static inline bool GrTextureTypeHasRestrictedSampling(GrTextureType type) { |
|
79 |
switch (type) { |
|
80 |
case GrTextureType::k2D: |
|
81 |
return false; |
|
82 |
case GrTextureType::kRectangle: |
|
83 |
return true; |
|
84 |
case GrTextureType::kExternal: |
|
85 |
return true; |
|
1162 | 86 |
default: |
87 |
SK_ABORT("Unexpected texture type"); |
|
88 |
} |
|
89 |
+ SkUNREACHABLE; |
|
90 |
} |
|
91 |
||
92 |
static constexpr bool GrSLTypeIsCombinedSamplerType(GrSLType type) { |
|
1164 | 93 |
switch (type) { |
94 |
case kTexture2DSampler_GrSLType: |
|
95 |
case kTextureExternalSampler_GrSLType: |
|
96 |
case kTexture2DRectSampler_GrSLType: |
|
97 |
return true; |
|
98 |
@@ -853,16 +855,17 @@ static inline size_t GrCompressedFormatD |
|
99 |
switch (compressionType) { |
|
100 |
case SkImage::kETC1_CompressionType: |
|
101 |
SkASSERT((width & 3) == 0); |
|
102 |
SkASSERT((height & 3) == 0); |
|
103 |
return (width >> 2) * (height >> 2) * 8; |
|
1162 | 104 |
} |
105 |
||
106 |
SK_ABORT("Invalid pixel config"); |
|
107 |
+ SkUNREACHABLE; |
|
108 |
} |
|
109 |
||
110 |
/** |
|
1164 | 111 |
* Like SkColorType this describes a layout of pixel data in CPU memory. It specifies the channels, |
112 |
* their type, and width. This exists so that the GPU backend can have private types that have no |
|
113 |
* analog in the public facing SkColorType enum and omit types not implemented in the GPU backend. |
|
114 |
* It does not refer to a texture format and the mapping to texture formats may be many-to-many. |
|
115 |
* It does not specify the sRGB encoding of the stored values. The components are listed in order of |
|
1162 | 116 |
diff --git a/gfx/skia/skia/src/core/SkGeometry.h b/gfx/skia/skia/src/core/SkGeometry.h |
117 |
--- a/gfx/skia/skia/src/core/SkGeometry.h |
|
118 |
+++ b/gfx/skia/skia/src/core/SkGeometry.h |
|
1164 | 119 |
@@ -177,28 +177,30 @@ static inline bool SkCubicIsDegenerate(S |
120 |
case SkCubicType::kLocalCusp: |
|
121 |
case SkCubicType::kCuspAtInfinity: |
|
122 |
return false; |
|
123 |
case SkCubicType::kQuadratic: |
|
124 |
case SkCubicType::kLineOrPoint: |
|
1162 | 125 |
return true; |
126 |
} |
|
127 |
SK_ABORT("Invalid SkCubicType"); |
|
128 |
+ SkUNREACHABLE; |
|
129 |
} |
|
130 |
||
131 |
static inline const char* SkCubicTypeName(SkCubicType type) { |
|
1164 | 132 |
switch (type) { |
133 |
case SkCubicType::kSerpentine: return "kSerpentine"; |
|
134 |
case SkCubicType::kLoop: return "kLoop"; |
|
135 |
case SkCubicType::kLocalCusp: return "kLocalCusp"; |
|
136 |
case SkCubicType::kCuspAtInfinity: return "kCuspAtInfinity"; |
|
137 |
case SkCubicType::kQuadratic: return "kQuadratic"; |
|
1162 | 138 |
case SkCubicType::kLineOrPoint: return "kLineOrPoint"; |
139 |
} |
|
140 |
SK_ABORT("Invalid SkCubicType"); |
|
141 |
+ SkUNREACHABLE; |
|
142 |
} |
|
143 |
||
144 |
/** Returns the cubic classification. |
|
1164 | 145 |
|
146 |
t[],s[] are set to the two homogeneous parameter values at which points the lines L & M |
|
147 |
intersect with K, sorted from smallest to largest and oriented so positive values of the |
|
148 |
implicit are on the "left" side. For a serpentine curve they are the inflection points. For a |
|
149 |
loop they are the double point. For a local cusp, they are both equal and denote the cusp point. |
|
1162 | 150 |
diff --git a/gfx/skia/skia/src/core/SkTextBlob.cpp b/gfx/skia/skia/src/core/SkTextBlob.cpp |
151 |
--- a/gfx/skia/skia/src/core/SkTextBlob.cpp |
|
152 |
+++ b/gfx/skia/skia/src/core/SkTextBlob.cpp |
|
1164 | 153 |
@@ -196,16 +196,17 @@ unsigned SkTextBlob::ScalarsPerGlyph(Gly |
154 |
} |
|
155 |
||
156 |
void SkTextBlob::operator delete(void* p) { |
|
157 |
sk_free(p); |
|
158 |
} |
|
1162 | 159 |
|
160 |
void* SkTextBlob::operator new(size_t) { |
|
161 |
SK_ABORT("All blobs are created by placement new."); |
|
162 |
+ SkUNREACHABLE; |
|
163 |
} |
|
164 |
||
165 |
void* SkTextBlob::operator new(size_t, void* p) { |
|
1164 | 166 |
return p; |
167 |
} |
|
168 |
||
169 |
SkTextBlobRunIterator::SkTextBlobRunIterator(const SkTextBlob* blob) |
|
170 |
: fCurrentRun(SkTextBlob::RunRecord::First(blob)) { |
|
1162 | 171 |
diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.cpp b/gfx/skia/skia/src/core/SkTypeface_remote.cpp |
172 |
--- a/gfx/skia/skia/src/core/SkTypeface_remote.cpp |
|
173 |
+++ b/gfx/skia/skia/src/core/SkTypeface_remote.cpp |
|
1164 | 174 |
@@ -24,16 +24,17 @@ void SkScalerContextProxy::initCache(SkS |
175 |
SkASSERT(cache != nullptr); |
|
176 |
||
177 |
fCache = cache; |
|
178 |
fStrikeCache = strikeCache; |
|
179 |
} |
|
1162 | 180 |
|
181 |
unsigned SkScalerContextProxy::generateGlyphCount() { |
|
182 |
SK_ABORT("Should never be called."); |
|
183 |
+ SkUNREACHABLE; |
|
184 |
} |
|
185 |
||
186 |
bool SkScalerContextProxy::generateAdvance(SkGlyph* glyph) { |
|
1164 | 187 |
return false; |
188 |
} |
|
189 |
||
190 |
void SkScalerContextProxy::generateMetrics(SkGlyph* glyph) { |
|
191 |
TRACE_EVENT1("skia", "generateMetrics", "rec", TRACE_STR_COPY(this->getRec().dump().c_str())); |
|
1162 | 192 |
diff --git a/gfx/skia/skia/src/core/SkTypeface_remote.h b/gfx/skia/skia/src/core/SkTypeface_remote.h |
193 |
--- a/gfx/skia/skia/src/core/SkTypeface_remote.h |
|
194 |
+++ b/gfx/skia/skia/src/core/SkTypeface_remote.h |
|
1164 | 195 |
@@ -58,46 +58,54 @@ public: |
196 |
, fGlyphCount{glyphCount} |
|
197 |
, fIsLogging{isLogging} |
|
198 |
, fDiscardableManager{std::move(manager)} {} |
|
199 |
SkFontID remoteTypefaceID() const {return fFontId;} |
|
200 |
int glyphCount() const {return fGlyphCount;} |
|
1162 | 201 |
bool isLogging() const {return fIsLogging;} |
202 |
||
203 |
protected: |
|
204 |
- int onGetUPEM() const override { SK_ABORT("Should never be called."); } |
|
205 |
+ int onGetUPEM() const override { SK_ABORT("Should never be called."); SkUNREACHABLE; } |
|
206 |
std::unique_ptr<SkStreamAsset> onOpenStream(int* ttcIndex) const override { |
|
207 |
SK_ABORT("Should never be called."); |
|
208 |
+ SkUNREACHABLE; |
|
209 |
} |
|
210 |
std::unique_ptr<SkFontData> onMakeFontData() const override { |
|
211 |
SK_ABORT("Should never be called."); |
|
212 |
+ SkUNREACHABLE; |
|
213 |
} |
|
214 |
sk_sp<SkTypeface> onMakeClone(const SkFontArguments& args) const override { |
|
215 |
SK_ABORT("Should never be called."); |
|
216 |
+ SkUNREACHABLE; |
|
217 |
} |
|
218 |
int onGetVariationDesignPosition(SkFontArguments::VariationPosition::Coordinate coordinates[], |
|
219 |
int coordinateCount) const override { |
|
220 |
SK_ABORT("Should never be called."); |
|
221 |
+ SkUNREACHABLE; |
|
222 |
} |
|
223 |
int onGetVariationDesignParameters(SkFontParameters::Variation::Axis parameters[], |
|
224 |
int parameterCount) const override { |
|
225 |
SK_ABORT("Should never be called."); |
|
226 |
+ SkUNREACHABLE; |
|
227 |
} |
|
228 |
void onGetFamilyName(SkString* familyName) const override { |
|
229 |
// Used by SkStrikeCache::DumpMemoryStatistics. |
|
1164 | 230 |
*familyName = ""; |
1162 | 231 |
} |
232 |
SkTypeface::LocalizedStrings* onCreateFamilyNameIterator() const override { |
|
233 |
SK_ABORT("Should never be called."); |
|
234 |
+ SkUNREACHABLE; |
|
235 |
} |
|
236 |
int onGetTableTags(SkFontTableTag tags[]) const override { |
|
237 |
SK_ABORT("Should never be called."); |
|
238 |
+ SkUNREACHABLE; |
|
239 |
} |
|
240 |
size_t onGetTableData(SkFontTableTag, size_t offset, size_t length, void* data) const override { |
|
241 |
SK_ABORT("Should never be called."); |
|
242 |
+ SkUNREACHABLE; |
|
243 |
} |
|
244 |
SkScalerContext* onCreateScalerContext(const SkScalerContextEffects& effects, |
|
245 |
const SkDescriptor* desc) const override { |
|
1164 | 246 |
return new SkScalerContextProxy(sk_ref_sp(const_cast<SkTypefaceProxy*>(this)), effects, |
247 |
desc, fDiscardableManager); |
|
248 |
} |
|
249 |
void onFilterRec(SkScalerContextRec* rec) const override { |
|
250 |
// The rec filtering is already applied by the server when generating |
|
251 |
@@ -111,26 +119,28 @@ protected: |
|
252 |
} |
|
253 |
||
254 |
void getPostScriptGlyphNames(SkString*) const override { |
|
255 |
SK_ABORT("Should never be called."); |
|
256 |
} |
|
1162 | 257 |
|
258 |
std::unique_ptr<SkAdvancedTypefaceMetrics> onGetAdvancedMetrics() const override { |
|
259 |
SK_ABORT("Should never be called."); |
|
260 |
+ SkUNREACHABLE; |
|
261 |
} |
|
262 |
void onCharsToGlyphs(const SkUnichar* chars, int count, SkGlyphID glyphs[]) const override { |
|
263 |
SK_ABORT("Should never be called."); |
|
1164 | 264 |
} |
265 |
int onCountGlyphs() const override { |
|
266 |
return this->glyphCount(); |
|
267 |
} |
|
1162 | 268 |
|
269 |
void* onGetCTFontRef() const override { |
|
270 |
SK_ABORT("Should never be called."); |
|
271 |
+ SkUNREACHABLE; |
|
272 |
} |
|
273 |
||
274 |
private: |
|
1164 | 275 |
const SkFontID fFontId; |
276 |
const int fGlyphCount; |
|
277 |
const bool fIsLogging; |
|
278 |
sk_sp<SkStrikeClient::DiscardableHandleManager> fDiscardableManager; |
|
279 |
||
1162 | 280 |
diff --git a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp |
281 |
--- a/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp |
|
282 |
+++ b/gfx/skia/skia/src/effects/imagefilters/SkBlurImageFilter.cpp |
|
1164 | 283 |
@@ -139,16 +139,17 @@ static GrTextureDomain::Mode to_texture_ |
284 |
case SkTileMode::kDecal: |
|
285 |
return GrTextureDomain::kDecal_Mode; |
|
286 |
case SkTileMode::kMirror: |
|
287 |
// TODO (michaelludwig) - Support mirror mode, treat as repeat for now |
|
288 |
case SkTileMode::kRepeat: |
|
1162 | 289 |
return GrTextureDomain::kRepeat_Mode; |
290 |
default: |
|
291 |
SK_ABORT("Unsupported tile mode."); |
|
292 |
+ SkUNREACHABLE; |
|
293 |
} |
|
294 |
} |
|
295 |
#endif |
|
1164 | 296 |
|
297 |
// This is defined by the SVG spec: |
|
298 |
// https://drafts.fxtf.org/filter-effects/#feGaussianBlurElement |
|
299 |
static int calculate_window(double sigma) { |
|
300 |
// NB 136 is the largest sigma that will not cause a buffer full of 255 mask values to overflow |
|
1162 | 301 |
diff --git a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp |
302 |
--- a/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp |
|
303 |
+++ b/gfx/skia/skia/src/effects/imagefilters/SkLightingImageFilter.cpp |
|
1164 | 304 |
@@ -1696,16 +1696,17 @@ static SkImageFilterLight* create_random |
305 |
return new SkPointLight(random_point3(random), random->nextU()); |
|
306 |
} |
|
307 |
case 2: { |
|
308 |
return new SkSpotLight(random_point3(random), random_point3(random), |
|
309 |
random->nextUScalar1(), random->nextUScalar1(), random->nextU()); |
|
1162 | 310 |
} |
311 |
default: |
|
312 |
SK_ABORT("Unexpected value."); |
|
313 |
+ SkUNREACHABLE; |
|
314 |
} |
|
315 |
} |
|
316 |
||
1164 | 317 |
std::unique_ptr<GrFragmentProcessor> GrDiffuseLightingEffect::TestCreate(GrProcessorTestData* d) { |
318 |
int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx |
|
319 |
: GrProcessorUnitTest::kAlphaTextureIdx; |
|
320 |
sk_sp<GrTextureProxy> proxy = d->textureProxy(texIdx); |
|
321 |
SkScalar surfaceScale = d->fRandom->nextSScalar1(); |
|
1162 | 322 |
diff --git a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp |
323 |
--- a/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp |
|
324 |
+++ b/gfx/skia/skia/src/fonts/SkFontMgr_indirect.cpp |
|
1164 | 325 |
@@ -64,16 +64,17 @@ int SkFontMgr_Indirect::onCountFamilies( |
326 |
} |
|
327 |
||
328 |
void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const { |
|
329 |
SK_ABORT("Not implemented"); |
|
330 |
} |
|
1162 | 331 |
|
332 |
SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const { |
|
333 |
SK_ABORT("Not implemented"); |
|
334 |
+ SkUNREACHABLE; |
|
335 |
} |
|
336 |
||
337 |
SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const { |
|
1164 | 338 |
return new SkStyleSet_Indirect(this, -1, fProxy->matchName(familyName)); |
339 |
} |
|
340 |
||
341 |
SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& id) const { |
|
342 |
if (id.fDataId == SkFontIdentity::kInvalidDataId) { |
|
1162 | 343 |
diff --git a/gfx/skia/skia/src/gpu/GrDataUtils.cpp b/gfx/skia/skia/src/gpu/GrDataUtils.cpp |
344 |
--- a/gfx/skia/skia/src/gpu/GrDataUtils.cpp |
|
345 |
+++ b/gfx/skia/skia/src/gpu/GrDataUtils.cpp |
|
1164 | 346 |
@@ -123,25 +123,27 @@ static int num_ETC1_blocks(int w, int h) |
347 |
||
348 |
size_t GrCompressedDataSize(SkImage::CompressionType type, int width, int height) { |
|
349 |
switch (type) { |
|
350 |
case SkImage::kETC1_CompressionType: |
|
351 |
int numBlocks = num_ETC1_blocks(width, height); |
|
1162 | 352 |
return numBlocks * sizeof(ETC1Block); |
353 |
} |
|
354 |
SK_ABORT("Unexpected compression type"); |
|
355 |
+ SkUNREACHABLE; |
|
356 |
} |
|
357 |
||
358 |
size_t GrCompressedRowBytes(SkImage::CompressionType type, int width) { |
|
1164 | 359 |
switch (type) { |
360 |
case SkImage::kETC1_CompressionType: |
|
361 |
int numBlocksWidth = num_ETC1_blocks_w(width); |
|
1162 | 362 |
return numBlocksWidth * sizeof(ETC1Block); |
363 |
} |
|
364 |
SK_ABORT("Unexpected compression type"); |
|
365 |
+ SkUNREACHABLE; |
|
366 |
} |
|
367 |
||
368 |
// Fill in 'dest' with ETC1 blocks derived from 'colorf' |
|
1164 | 369 |
static void fillin_ETC1_with_color(int width, int height, const SkColor4f& colorf, void* dest) { |
370 |
SkColor color = colorf.toSkColor(); |
|
371 |
||
372 |
ETC1Block block; |
|
373 |
create_etc1_block(color, &block); |
|
1162 | 374 |
diff --git a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h |
375 |
--- a/gfx/skia/skia/src/gpu/GrFragmentProcessor.h |
|
376 |
+++ b/gfx/skia/skia/src/gpu/GrFragmentProcessor.h |
|
1164 | 377 |
@@ -370,16 +370,17 @@ protected: |
378 |
const Args&... samps) { |
|
379 |
return (0 == i) ? samp0 : IthTextureSampler(i - 1, samps...); |
|
380 |
} |
|
381 |
inline static const TextureSampler& IthTextureSampler(int i); |
|
382 |
||
1162 | 383 |
private: |
384 |
virtual SkPMColor4f constantOutputForConstantInput(const SkPMColor4f& /* inputColor */) const { |
|
385 |
SK_ABORT("Subclass must override this if advertising this optimization."); |
|
386 |
+ SkUNREACHABLE; |
|
387 |
} |
|
388 |
||
389 |
/** Returns a new instance of the appropriate *GL* implementation class |
|
1164 | 390 |
for the given GrFragmentProcessor; caller is responsible for deleting |
391 |
the object. */ |
|
392 |
virtual GrGLSLFragmentProcessor* onCreateGLSLInstance() const = 0; |
|
393 |
||
394 |
/** Implemented using GLFragmentProcessor::GenKey as described in this class's comment. */ |
|
1162 | 395 |
diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.cpp b/gfx/skia/skia/src/gpu/GrPathRendering.cpp |
396 |
--- a/gfx/skia/skia/src/gpu/GrPathRendering.cpp |
|
397 |
+++ b/gfx/skia/skia/src/gpu/GrPathRendering.cpp |
|
1164 | 398 |
@@ -14,16 +14,17 @@ |
399 |
#include "src/gpu/GrPathRendering.h" |
|
400 |
#include "src/gpu/GrProgramInfo.h" |
|
401 |
#include "src/gpu/GrRenderTarget.h" |
|
402 |
||
403 |
const GrUserStencilSettings& GrPathRendering::GetStencilPassSettings(FillType fill) { |
|
1162 | 404 |
switch (fill) { |
405 |
default: |
|
406 |
SK_ABORT("Unexpected path fill."); |
|
407 |
+ SkUNREACHABLE; |
|
408 |
case GrPathRendering::kWinding_FillType: { |
|
409 |
constexpr static GrUserStencilSettings kWindingStencilPass( |
|
410 |
GrUserStencilSettings::StaticInit< |
|
1164 | 411 |
0xffff, |
412 |
GrUserStencilTest::kAlwaysIfInClip, |
|
413 |
0xffff, |
|
414 |
GrUserStencilOp::kIncWrap, |
|
415 |
GrUserStencilOp::kIncWrap, |
|
1162 | 416 |
diff --git a/gfx/skia/skia/src/gpu/GrPathRendering.h b/gfx/skia/skia/src/gpu/GrPathRendering.h |
417 |
--- a/gfx/skia/skia/src/gpu/GrPathRendering.h |
|
418 |
+++ b/gfx/skia/skia/src/gpu/GrPathRendering.h |
|
1164 | 419 |
@@ -58,16 +58,17 @@ public: |
420 |
return 1; |
|
421 |
case kTranslate_PathTransformType: |
|
422 |
return 2; |
|
423 |
case kAffine_PathTransformType: |
|
424 |
return 6; |
|
1162 | 425 |
|
426 |
default: |
|
427 |
SK_ABORT("Unknown path transform type"); |
|
428 |
+ SkUNREACHABLE; |
|
429 |
} |
|
430 |
} |
|
431 |
||
1164 | 432 |
// No native support for inverse at this time |
433 |
enum FillType { |
|
434 |
/** Specifies that "inside" is computed by a non-zero sum of signed |
|
435 |
edge crossings |
|
436 |
*/ |
|
1162 | 437 |
diff --git a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp |
438 |
--- a/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp |
|
439 |
+++ b/gfx/skia/skia/src/gpu/GrProcessorUnitTest.cpp |
|
1164 | 440 |
@@ -15,11 +15,12 @@ std::unique_ptr<GrFragmentProcessor> GrP |
441 |
std::unique_ptr<GrFragmentProcessor> fp; |
|
442 |
do { |
|
443 |
fp = GrFragmentProcessorTestFactory::Make(data); |
|
444 |
SkASSERT(fp); |
|
445 |
} while (fp->numChildProcessors() != 0); |
|
1162 | 446 |
return fp; |
447 |
#else |
|
448 |
SK_ABORT("Should not be called if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS"); |
|
449 |
+ SkUNREACHABLE; |
|
450 |
#endif |
|
451 |
} |
|
452 |
#endif |
|
453 |
diff --git a/gfx/skia/skia/src/gpu/GrReducedClip.cpp b/gfx/skia/skia/src/gpu/GrReducedClip.cpp |
|
454 |
--- a/gfx/skia/skia/src/gpu/GrReducedClip.cpp |
|
455 |
+++ b/gfx/skia/skia/src/gpu/GrReducedClip.cpp |
|
1164 | 456 |
@@ -520,16 +520,17 @@ GrReducedClip::ClipResult GrReducedClip: |
457 |
GrAA(element->isAA())); |
|
458 |
||
459 |
case Element::DeviceSpaceType::kPath: |
|
460 |
return this->addAnalyticFP(element->getDeviceSpacePath(), |
|
461 |
Invert(element->isInverseFilled()), GrAA(element->isAA())); |
|
1162 | 462 |
} |
463 |
||
464 |
SK_ABORT("Unexpected DeviceSpaceType"); |
|
465 |
+ SkUNREACHABLE; |
|
466 |
} |
|
467 |
||
468 |
GrReducedClip::ClipResult GrReducedClip::clipOutsideElement(const Element* element) { |
|
1164 | 469 |
switch (element->getDeviceSpaceType()) { |
470 |
case Element::DeviceSpaceType::kEmpty: |
|
471 |
return ClipResult::kMadeEmpty; |
|
472 |
||
473 |
case Element::DeviceSpaceType::kRect: |
|
474 |
@@ -586,16 +587,17 @@ GrReducedClip::ClipResult GrReducedClip: |
|
475 |
} |
|
476 |
||
477 |
case Element::DeviceSpaceType::kPath: |
|
478 |
return this->addAnalyticFP(element->getDeviceSpacePath(), |
|
479 |
Invert(!element->isInverseFilled()), GrAA(element->isAA())); |
|
1162 | 480 |
} |
481 |
||
482 |
SK_ABORT("Unexpected DeviceSpaceType"); |
|
483 |
+ SkUNREACHABLE; |
|
484 |
} |
|
485 |
||
486 |
inline void GrReducedClip::addWindowRectangle(const SkRect& elementInteriorRect, bool elementIsAA) { |
|
1164 | 487 |
SkIRect window; |
488 |
if (!elementIsAA) { |
|
489 |
elementInteriorRect.round(&window); |
|
490 |
} else { |
|
491 |
elementInteriorRect.roundIn(&window); |
|
1162 | 492 |
diff --git a/gfx/skia/skia/src/gpu/GrResourceCache.cpp b/gfx/skia/skia/src/gpu/GrResourceCache.cpp |
493 |
--- a/gfx/skia/skia/src/gpu/GrResourceCache.cpp |
|
494 |
+++ b/gfx/skia/skia/src/gpu/GrResourceCache.cpp |
|
1164 | 495 |
@@ -35,27 +35,29 @@ DECLARE_SKMESSAGEBUS_MESSAGE(GrTextureFr |
496 |
////////////////////////////////////////////////////////////////////////////// |
|
497 |
||
498 |
GrScratchKey::ResourceType GrScratchKey::GenerateResourceType() { |
|
499 |
static std::atomic<int32_t> nextType{INHERITED::kInvalidDomain + 1}; |
|
500 |
||
1162 | 501 |
int32_t type = nextType++; |
502 |
if (type > SkTo<int32_t>(UINT16_MAX)) { |
|
503 |
SK_ABORT("Too many Resource Types"); |
|
504 |
+ SkUNREACHABLE; |
|
505 |
} |
|
506 |
||
507 |
return static_cast<ResourceType>(type); |
|
1164 | 508 |
} |
509 |
||
510 |
GrUniqueKey::Domain GrUniqueKey::GenerateDomain() { |
|
511 |
static std::atomic<int32_t> nextDomain{INHERITED::kInvalidDomain + 1}; |
|
512 |
||
1162 | 513 |
int32_t domain = nextDomain++; |
514 |
if (domain > SkTo<int32_t>(UINT16_MAX)) { |
|
515 |
SK_ABORT("Too many GrUniqueKey Domains"); |
|
516 |
+ SkUNREACHABLE; |
|
517 |
} |
|
518 |
||
519 |
return static_cast<Domain>(domain); |
|
1164 | 520 |
} |
521 |
||
522 |
uint32_t GrResourceKeyHash(const uint32_t* data, size_t size) { |
|
523 |
return SkOpts::hash(data, size); |
|
524 |
} |
|
1162 | 525 |
diff --git a/gfx/skia/skia/src/gpu/GrShaderVar.cpp b/gfx/skia/skia/src/gpu/GrShaderVar.cpp |
526 |
--- a/gfx/skia/skia/src/gpu/GrShaderVar.cpp |
|
527 |
+++ b/gfx/skia/skia/src/gpu/GrShaderVar.cpp |
|
1164 | 528 |
@@ -13,30 +13,32 @@ static const char* type_modifier_string( |
529 |
switch (t) { |
|
530 |
case GrShaderVar::kNone_TypeModifier: return ""; |
|
531 |
case GrShaderVar::kIn_TypeModifier: return "in"; |
|
532 |
case GrShaderVar::kInOut_TypeModifier: return "inout"; |
|
533 |
case GrShaderVar::kOut_TypeModifier: return "out"; |
|
1162 | 534 |
case GrShaderVar::kUniform_TypeModifier: return "uniform"; |
535 |
} |
|
536 |
SK_ABORT("Unknown shader variable type modifier."); |
|
537 |
+ SkUNREACHABLE; |
|
538 |
} |
|
539 |
||
540 |
void GrShaderVar::setIOType(GrIOType ioType) { |
|
1164 | 541 |
switch (ioType) { |
542 |
case kRW_GrIOType: |
|
543 |
return; |
|
544 |
case kRead_GrIOType: |
|
545 |
this->addModifier("readonly"); |
|
546 |
return; |
|
547 |
case kWrite_GrIOType: |
|
548 |
this->addModifier("writeonly"); |
|
1162 | 549 |
return; |
550 |
} |
|
551 |
SK_ABORT("Unknown io type."); |
|
552 |
+ SkUNREACHABLE; |
|
553 |
} |
|
554 |
||
555 |
void GrShaderVar::appendDecl(const GrShaderCaps* shaderCaps, SkString* out) const { |
|
1164 | 556 |
SkString layout = fLayoutQualifier; |
557 |
if (!fLayoutQualifier.isEmpty()) { |
|
558 |
out->appendf("layout(%s) ", fLayoutQualifier.c_str()); |
|
559 |
} |
|
560 |
out->append(fExtraModifiers); |
|
1162 | 561 |
diff --git a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp |
562 |
--- a/gfx/skia/skia/src/gpu/SkGpuDevice.cpp |
|
563 |
+++ b/gfx/skia/skia/src/gpu/SkGpuDevice.cpp |
|
1164 | 564 |
@@ -278,16 +278,17 @@ static inline GrPrimitiveType point_mode |
565 |
case SkCanvas::kPoints_PointMode: |
|
566 |
return GrPrimitiveType::kPoints; |
|
567 |
case SkCanvas::kLines_PointMode: |
|
568 |
return GrPrimitiveType::kLines; |
|
569 |
case SkCanvas::kPolygon_PointMode: |
|
1162 | 570 |
return GrPrimitiveType::kLineStrip; |
571 |
} |
|
572 |
SK_ABORT("Unexpected mode"); |
|
573 |
+ SkUNREACHABLE; |
|
574 |
} |
|
575 |
||
576 |
void SkGpuDevice::drawPoints(SkCanvas::PointMode mode, |
|
1164 | 577 |
size_t count, const SkPoint pts[], const SkPaint& paint) { |
578 |
ASSERT_SINGLE_OWNER |
|
579 |
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice", "drawPoints", fContext.get()); |
|
580 |
SkScalar width = paint.getStrokeWidth(); |
|
581 |
if (width < 0) { |
|
1162 | 582 |
diff --git a/gfx/skia/skia/src/gpu/SkGr.h b/gfx/skia/skia/src/gpu/SkGr.h |
583 |
--- a/gfx/skia/skia/src/gpu/SkGr.h |
|
584 |
+++ b/gfx/skia/skia/src/gpu/SkGr.h |
|
1164 | 585 |
@@ -154,16 +154,17 @@ static inline GrPrimitiveType SkVertexMo |
586 |
case SkVertices::kTriangles_VertexMode: |
|
587 |
return GrPrimitiveType::kTriangles; |
|
588 |
case SkVertices::kTriangleStrip_VertexMode: |
|
589 |
return GrPrimitiveType::kTriangleStrip; |
|
590 |
case SkVertices::kTriangleFan_VertexMode: |
|
1162 | 591 |
break; |
592 |
} |
|
593 |
SK_ABORT("Invalid mode"); |
|
594 |
+ SkUNREACHABLE; |
|
595 |
} |
|
596 |
||
597 |
////////////////////////////////////////////////////////////////////////////// |
|
1164 | 598 |
|
599 |
GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkBlendModeCoeff::kZero); |
|
600 |
GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkBlendModeCoeff::kOne); |
|
601 |
GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkBlendModeCoeff::kSC); |
|
602 |
GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkBlendModeCoeff::kISC); |
|
1162 | 603 |
diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h |
604 |
--- a/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h |
|
605 |
+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCCoverageProcessor.h |
|
1164 | 606 |
@@ -235,16 +235,17 @@ inline const char* GrCCCoverageProcessor |
607 |
switch (type) { |
|
608 |
case PrimitiveType::kTriangles: return "kTriangles"; |
|
609 |
case PrimitiveType::kWeightedTriangles: return "kWeightedTriangles"; |
|
610 |
case PrimitiveType::kQuadratics: return "kQuadratics"; |
|
611 |
case PrimitiveType::kCubics: return "kCubics"; |
|
1162 | 612 |
case PrimitiveType::kConics: return "kConics"; |
613 |
} |
|
614 |
SK_ABORT("Invalid PrimitiveType"); |
|
615 |
+ SkUNREACHABLE; |
|
616 |
} |
|
617 |
||
618 |
inline void GrCCCoverageProcessor::TriPointInstance::set( |
|
1164 | 619 |
const SkPoint p[3], const Sk2f& translate, Ordering ordering) { |
620 |
this->set(p[0], p[1], p[2], translate, ordering); |
|
621 |
} |
|
622 |
||
623 |
inline void GrCCCoverageProcessor::TriPointInstance::set( |
|
1162 | 624 |
diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp |
625 |
--- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp |
|
626 |
+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.cpp |
|
1164 | 627 |
@@ -55,16 +55,17 @@ static GrCCStrokeGeometry::Verb join_ver |
628 |
case SkPaint::kBevel_Join: |
|
629 |
return Verb::kBevelJoin; |
|
630 |
case SkPaint::kMiter_Join: |
|
631 |
return Verb::kMiterJoin; |
|
632 |
case SkPaint::kRound_Join: |
|
1162 | 633 |
return Verb::kRoundJoin; |
634 |
} |
|
635 |
SK_ABORT("Invalid SkPaint::Join."); |
|
636 |
+ SkUNREACHABLE; |
|
637 |
} |
|
638 |
||
639 |
void GrCCStrokeGeometry::beginPath(const SkStrokeRec& stroke, float strokeDevWidth, |
|
1164 | 640 |
InstanceTallies* tallies) { |
641 |
SkASSERT(!fInsideContour); |
|
642 |
// Client should have already converted the stroke to device space (i.e. width=1 for hairline). |
|
643 |
SkASSERT(strokeDevWidth > 0); |
|
644 |
||
1162 | 645 |
diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h |
646 |
--- a/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h |
|
647 |
+++ b/gfx/skia/skia/src/gpu/ccpr/GrCCStrokeGeometry.h |
|
1164 | 648 |
@@ -170,10 +170,11 @@ inline bool GrCCStrokeGeometry::IsIntern |
649 |
case Verb::kMiterJoin: |
|
650 |
case Verb::kRoundJoin: |
|
651 |
case Verb::kSquareCap: |
|
652 |
case Verb::kRoundCap: |
|
653 |
case Verb::kEndContour: |
|
1162 | 654 |
return false; |
655 |
} |
|
656 |
SK_ABORT("Invalid GrCCStrokeGeometry::Verb."); |
|
657 |
+ SkUNREACHABLE; |
|
658 |
} |
|
659 |
#endif |
|
660 |
diff --git a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp |
|
661 |
--- a/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp |
|
662 |
+++ b/gfx/skia/skia/src/gpu/ccpr/GrCoverageCountingPathRenderer.cpp |
|
1164 | 663 |
@@ -159,16 +159,17 @@ GrPathRenderer::CanDrawPath GrCoverageCo |
664 |
return CanDrawPath::kYes; |
|
665 |
} |
|
666 |
||
667 |
case SkStrokeRec::kStrokeAndFill_Style: |
|
668 |
return CanDrawPath::kNo; |
|
1162 | 669 |
} |
670 |
||
671 |
SK_ABORT("Invalid stroke style."); |
|
672 |
+ SkUNREACHABLE; |
|
673 |
} |
|
674 |
||
675 |
bool GrCoverageCountingPathRenderer::onDrawPath(const DrawPathArgs& args) { |
|
1164 | 676 |
SkASSERT(!fFlushing); |
677 |
||
678 |
SkIRect clipIBounds; |
|
679 |
GrRenderTargetContext* rtc = args.fRenderTargetContext; |
|
680 |
args.fClip->getConservativeBounds(rtc->width(), rtc->height(), &clipIBounds, nullptr); |
|
1162 | 681 |
diff --git a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp |
682 |
--- a/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp |
|
683 |
+++ b/gfx/skia/skia/src/gpu/ccpr/GrVSCoverageProcessor.cpp |
|
1164 | 684 |
@@ -545,9 +545,10 @@ GrGLSLPrimitiveProcessor* GrVSCoveragePr |
685 |
case PrimitiveType::kWeightedTriangles: |
|
686 |
return new Impl(std::move(shader), 3); |
|
687 |
case PrimitiveType::kQuadratics: |
|
688 |
case PrimitiveType::kCubics: |
|
689 |
case PrimitiveType::kConics: |
|
1162 | 690 |
return new Impl(std::move(shader), 4); |
691 |
} |
|
692 |
SK_ABORT("Invalid PrimitiveType"); |
|
693 |
+ SkUNREACHABLE; |
|
694 |
} |
|
695 |
diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp |
|
696 |
--- a/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp |
|
697 |
+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnOpsRenderPass.cpp |
|
1164 | 698 |
@@ -34,17 +34,19 @@ static dawn::LoadOp to_dawn_load_op(GrLo |
699 |
// Load should be equivalent to DontCare for desktop; Clear would |
|
700 |
// probably be better for tilers. If Dawn does add DontCare |
|
701 |
// as an extension, use it here. |
|
702 |
return dawn::LoadOp::Load; |
|
703 |
case GrLoadOp::kClear: |
|
1162 | 704 |
return dawn::LoadOp::Clear; |
705 |
default: |
|
706 |
SK_ABORT("Invalid LoadOp"); |
|
707 |
+ SkUNREACHABLE; |
|
708 |
} |
|
709 |
+ SkUNREACHABLE; |
|
710 |
} |
|
711 |
||
712 |
GrDawnOpsRenderPass::GrDawnOpsRenderPass(GrDawnGpu* gpu, GrRenderTarget* rt, GrSurfaceOrigin origin, |
|
1164 | 713 |
const LoadAndStoreInfo& colorInfo, |
714 |
const StencilLoadAndStoreInfo& stencilInfo) |
|
715 |
: INHERITED(rt, origin) |
|
716 |
, fGpu(gpu) |
|
717 |
, fColorInfo(colorInfo) { |
|
1162 | 718 |
diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp |
719 |
--- a/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp |
|
720 |
+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnUniformHandler.cpp |
|
1164 | 721 |
@@ -90,16 +90,17 @@ uint32_t grsltype_to_alignment_mask(GrSL |
722 |
case kTexture2DSampler_GrSLType: |
|
723 |
case kTextureExternalSampler_GrSLType: |
|
724 |
case kTexture2DRectSampler_GrSLType: |
|
725 |
case kTexture2D_GrSLType: |
|
726 |
case kSampler_GrSLType: |
|
1162 | 727 |
break; |
728 |
} |
|
729 |
SK_ABORT("Unexpected type"); |
|
730 |
+ SkUNREACHABLE; |
|
731 |
} |
|
732 |
||
733 |
static inline uint32_t grsltype_to_size(GrSLType type) { |
|
1164 | 734 |
switch(type) { |
735 |
case kByte_GrSLType: |
|
736 |
case kUByte_GrSLType: |
|
737 |
return 1; |
|
738 |
case kByte2_GrSLType: |
|
739 |
@@ -168,16 +169,17 @@ static inline uint32_t grsltype_to_size( |
|
740 |
case kTexture2DSampler_GrSLType: |
|
741 |
case kTextureExternalSampler_GrSLType: |
|
742 |
case kTexture2DRectSampler_GrSLType: |
|
743 |
case kTexture2D_GrSLType: |
|
744 |
case kSampler_GrSLType: |
|
1162 | 745 |
break; |
746 |
} |
|
747 |
SK_ABORT("Unexpected type"); |
|
748 |
+ SkUNREACHABLE; |
|
749 |
} |
|
750 |
||
751 |
uint32_t get_ubo_offset(uint32_t* currentOffset, |
|
1164 | 752 |
GrSLType type, |
753 |
int arrayCount) { |
|
754 |
uint32_t alignmentMask = grsltype_to_alignment_mask(type); |
|
755 |
// We want to use the std140 layout here, so we must make arrays align to 16 bytes. |
|
756 |
if (arrayCount || type == kFloat2x2_GrSLType) { |
|
1162 | 757 |
diff --git a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp |
758 |
--- a/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp |
|
759 |
+++ b/gfx/skia/skia/src/gpu/dawn/GrDawnVaryingHandler.cpp |
|
1164 | 760 |
@@ -71,16 +71,17 @@ static inline int grsltype_to_location_s |
761 |
case kUByte_GrSLType: |
|
762 |
return 1; |
|
763 |
case kTexture2D_GrSLType: |
|
764 |
return 0; |
|
765 |
case kSampler_GrSLType: |
|
1162 | 766 |
return 0; |
767 |
} |
|
768 |
SK_ABORT("Unexpected type"); |
|
769 |
+ SkUNREACHABLE; |
|
770 |
} |
|
771 |
||
772 |
static void finalize_helper(GrDawnVaryingHandler::VarArray& vars) { |
|
1164 | 773 |
int locationIndex = 0; |
774 |
for (int i = 0; i < vars.count(); ++i) { |
|
775 |
GrShaderVar& var = vars[i]; |
|
776 |
SkString location; |
|
777 |
location.appendf("location = %d", locationIndex); |
|
1162 | 778 |
diff --git a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp |
779 |
--- a/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp |
|
780 |
+++ b/gfx/skia/skia/src/gpu/effects/GrConstColorProcessor.fp |
|
1164 | 781 |
@@ -53,16 +53,17 @@ void main() { |
782 |
case InputMode::kIgnore: |
|
783 |
return color; |
|
784 |
case InputMode::kModulateA: |
|
785 |
return color * input.fA; |
|
786 |
case InputMode::kModulateRGBA: |
|
1162 | 787 |
return color * input; |
788 |
} |
|
789 |
SK_ABORT("Unexpected mode"); |
|
790 |
+ SkUNREACHABLE; |
|
791 |
} |
|
792 |
} |
|
793 |
||
1164 | 794 |
@test(d) { |
795 |
SkPMColor4f color; |
|
796 |
int colorPicker = d->fRandom->nextULessThan(3); |
|
797 |
switch (colorPicker) { |
|
798 |
case 0: { |
|
1162 | 799 |
diff --git a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp |
800 |
--- a/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp |
|
801 |
+++ b/gfx/skia/skia/src/gpu/effects/GrCoverageSetOpXP.cpp |
|
1164 | 802 |
@@ -199,16 +199,17 @@ const GrXPFactory* GrCoverageSetOpXPFact |
803 |
static _CONSTEXPR_ const GrCoverageSetOpXPFactory gRevDiffCDXPF( |
|
804 |
SkRegion::kReverseDifference_Op, false); |
|
805 |
return &gRevDiffCDXPF; |
|
806 |
} |
|
807 |
} |
|
1162 | 808 |
} |
809 |
#undef _CONSTEXPR_ |
|
810 |
SK_ABORT("Unknown region op."); |
|
811 |
+ SkUNREACHABLE; |
|
812 |
} |
|
813 |
||
814 |
sk_sp<const GrXferProcessor> GrCoverageSetOpXPFactory::makeXferProcessor( |
|
1164 | 815 |
const GrProcessorAnalysisColor&, |
816 |
GrProcessorAnalysisCoverage, |
|
817 |
bool hasMixedSamples, |
|
818 |
const GrCaps& caps, |
|
819 |
GrClampType) const { |
|
1162 | 820 |
diff --git a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
821 |
--- a/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
|
822 |
+++ b/gfx/skia/skia/src/gpu/effects/GrPorterDuffXferProcessor.cpp |
|
1164 | 823 |
@@ -748,16 +748,17 @@ const GrXPFactory* GrPorterDuffXPFactory |
824 |
case SkBlendMode::kPlus: |
|
825 |
return &gPlusPDXPF; |
|
826 |
case SkBlendMode::kModulate: |
|
827 |
return &gModulatePDXPF; |
|
828 |
case SkBlendMode::kScreen: |
|
1162 | 829 |
return &gScreenPDXPF; |
830 |
default: |
|
831 |
SK_ABORT("Unexpected blend mode."); |
|
832 |
+ SkUNREACHABLE; |
|
833 |
} |
|
834 |
} |
|
835 |
||
1164 | 836 |
sk_sp<const GrXferProcessor> GrPorterDuffXPFactory::makeXferProcessor( |
837 |
const GrProcessorAnalysisColor& color, GrProcessorAnalysisCoverage coverage, |
|
838 |
bool hasMixedSamples, const GrCaps& caps, GrClampType clampType) const { |
|
839 |
BlendFormula blendFormula; |
|
840 |
bool isLCD = coverage == GrProcessorAnalysisCoverage::kLCD; |
|
1162 | 841 |
diff --git a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp |
842 |
--- a/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp |
|
843 |
+++ b/gfx/skia/skia/src/gpu/effects/GrSkSLFP.cpp |
|
1164 | 844 |
@@ -149,16 +149,17 @@ public: |
845 |
return kHalf4x4_GrSLType; |
|
846 |
} else if (type == *fContext.fBool_Type) { |
|
847 |
return kBool_GrSLType; |
|
848 |
} else if (type == *fContext.fInt_Type) { |
|
849 |
return kInt_GrSLType; |
|
1162 | 850 |
} |
851 |
printf("%s\n", SkSL::String(type.fName).c_str()); |
|
852 |
SK_ABORT("unsupported uniform type"); |
|
853 |
+ SkUNREACHABLE; |
|
854 |
} |
|
855 |
||
856 |
void emitCode(EmitArgs& args) override { |
|
1164 | 857 |
for (const auto& v : fInAndUniformVars) { |
858 |
if (v->fModifiers.fFlags & SkSL::Modifiers::kUniform_Flag && v->fType != |
|
859 |
*fContext.fFragmentProcessor_Type) { |
|
860 |
fUniformHandles.push_back(args.fUniformHandler->addUniform( |
|
861 |
kFragment_GrShaderFlag, |
|
862 |
@@ -563,11 +564,12 @@ std::unique_ptr<GrFragmentProcessor> GrS |
|
863 |
} |
|
864 |
std::unique_ptr<GrSkSLFP> result = GrSkSLFP::Make(d->context(), overdrawIndex, |
|
865 |
"Overdraw", SKSL_OVERDRAW_SRC, |
|
866 |
&inputs, sizeof(inputs)); |
|
867 |
return std::unique_ptr<GrFragmentProcessor>(result.release()); |
|
1162 | 868 |
} |
869 |
} |
|
870 |
SK_ABORT("unreachable"); |
|
871 |
+ SkUNREACHABLE; |
|
872 |
} |
|
873 |
||
874 |
#endif |
|
875 |
diff --git a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h |
|
876 |
--- a/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h |
|
877 |
+++ b/gfx/skia/skia/src/gpu/effects/generated/GrConstColorProcessor.h |
|
1164 | 878 |
@@ -36,16 +36,17 @@ public: |
879 |
case InputMode::kIgnore: |
|
880 |
return color; |
|
881 |
case InputMode::kModulateA: |
|
882 |
return color * input.fA; |
|
883 |
case InputMode::kModulateRGBA: |
|
1162 | 884 |
return color * input; |
885 |
} |
|
886 |
SK_ABORT("Unexpected mode"); |
|
887 |
+ SkUNREACHABLE; |
|
888 |
} |
|
889 |
static std::unique_ptr<GrFragmentProcessor> Make(SkPMColor4f color, InputMode mode) { |
|
890 |
return std::unique_ptr<GrFragmentProcessor>(new GrConstColorProcessor(color, mode)); |
|
1164 | 891 |
} |
892 |
GrConstColorProcessor(const GrConstColorProcessor& src); |
|
893 |
std::unique_ptr<GrFragmentProcessor> clone() const override; |
|
894 |
const char* name() const override { return "ConstColorProcessor"; } |
|
895 |
SkPMColor4f color; |
|
1162 | 896 |
diff --git a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp |
897 |
--- a/gfx/skia/skia/src/gpu/geometry/GrShape.cpp |
|
898 |
+++ b/gfx/skia/skia/src/gpu/geometry/GrShape.cpp |
|
1164 | 899 |
@@ -159,16 +159,17 @@ SkRect GrShape::bounds() const { |
900 |
return fRRectData.fRRect.getBounds(); |
|
901 |
case Type::kArc: |
|
902 |
// Could make this less conservative by looking at angles. |
|
903 |
return fArcData.fOval; |
|
904 |
case Type::kPath: |
|
1162 | 905 |
return this->path().getBounds(); |
906 |
} |
|
907 |
SK_ABORT("Unknown shape type"); |
|
908 |
+ SkUNREACHABLE; |
|
909 |
} |
|
910 |
||
911 |
SkRect GrShape::styledBounds() const { |
|
1164 | 912 |
if (this->isEmpty() && !fStyle.hasNonDashPathEffect()) { |
913 |
return SkRect::MakeEmpty(); |
|
914 |
} |
|
915 |
||
916 |
SkRect bounds; |
|
917 |
@@ -249,16 +250,17 @@ int GrShape::unstyledKeySize() const { |
|
918 |
if (dataKeySize >= 0) { |
|
919 |
return dataKeySize; |
|
920 |
} |
|
921 |
// The key is the path ID and fill type. |
|
922 |
return 2; |
|
1162 | 923 |
} |
924 |
} |
|
925 |
SK_ABORT("Should never get here."); |
|
926 |
+ SkUNREACHABLE; |
|
927 |
} |
|
928 |
||
929 |
void GrShape::writeUnstyledKey(uint32_t* key) const { |
|
1164 | 930 |
SkASSERT(this->unstyledKeySize()); |
931 |
SkDEBUGCODE(uint32_t* origKey = key;) |
|
932 |
if (fInheritedKey.count()) { |
|
933 |
memcpy(key, fInheritedKey.get(), sizeof(uint32_t) * fInheritedKey.count()); |
|
934 |
SkDEBUGCODE(key += fInheritedKey.count();) |
|
1162 | 935 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp |
936 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp |
|
937 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLCaps.cpp |
|
1164 | 938 |
@@ -4154,16 +4154,17 @@ GrBackendFormat GrGLCaps::getBackendForm |
939 |
case SkImage::kETC1_CompressionType: |
|
940 |
// if ETC2 is available default to that format |
|
941 |
if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) { |
|
942 |
return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_RGB8_ETC2, GR_GL_TEXTURE_2D); |
|
943 |
} |
|
1162 | 944 |
return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_ETC1_RGB8, GR_GL_TEXTURE_2D); |
945 |
} |
|
946 |
SK_ABORT("Invalid compression type"); |
|
947 |
+ SkUNREACHABLE; |
|
948 |
} |
|
949 |
||
950 |
GrSwizzle GrGLCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const { |
|
1164 | 951 |
const auto& info = this->getFormatInfo(format.asGLFormat()); |
952 |
for (int i = 0; i < info.fColorTypeInfoCount; ++i) { |
|
953 |
const auto& ctInfo = info.fColorTypeInfos[i]; |
|
954 |
if (ctInfo.fColorType == colorType) { |
|
955 |
return ctInfo.fTextureSwizzle; |
|
1162 | 956 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp |
957 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp |
|
958 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLGLSL.cpp |
|
1164 | 959 |
@@ -63,9 +63,10 @@ bool GrGLGetGLSLGeneration(const GrGLInt |
960 |
if (ver >= GR_GLSL_VER(2,0)) { |
|
961 |
*generation = k330_GrGLSLGeneration; // ES 3.0 |
|
962 |
} else { |
|
963 |
*generation = k110_GrGLSLGeneration; |
|
964 |
} |
|
1162 | 965 |
return true; |
966 |
} |
|
967 |
SK_ABORT("Unknown GL Standard"); |
|
968 |
+ SkUNREACHABLE; |
|
969 |
} |
|
970 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp |
|
971 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp |
|
972 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLGpu.cpp |
|
1164 | 973 |
@@ -191,16 +191,17 @@ static int gl_target_to_binding_index(Gr |
974 |
case GR_GL_TEXTURE_2D: |
|
975 |
return 0; |
|
976 |
case GR_GL_TEXTURE_RECTANGLE: |
|
977 |
return 1; |
|
978 |
case GR_GL_TEXTURE_EXTERNAL: |
|
1162 | 979 |
return 2; |
980 |
} |
|
981 |
SK_ABORT("Unexpected GL texture target."); |
|
982 |
+ SkUNREACHABLE; |
|
983 |
} |
|
984 |
||
985 |
GrGpuResource::UniqueID GrGLGpu::TextureUnitBindings::boundID(GrGLenum target) const { |
|
1164 | 986 |
return fTargetBindings[gl_target_to_binding_index(target)].fBoundResourceID; |
987 |
} |
|
988 |
||
989 |
bool GrGLGpu::TextureUnitBindings::hasBeenModified(GrGLenum target) const { |
|
990 |
return fTargetBindings[gl_target_to_binding_index(target)].fHasBeenModified; |
|
991 |
@@ -229,39 +230,42 @@ void GrGLGpu::TextureUnitBindings::inval |
|
992 |
||
993 |
static GrGLenum filter_to_gl_mag_filter(GrSamplerState::Filter filter) { |
|
994 |
switch (filter) { |
|
995 |
case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST; |
|
996 |
case GrSamplerState::Filter::kBilerp: return GR_GL_LINEAR; |
|
1162 | 997 |
case GrSamplerState::Filter::kMipMap: return GR_GL_LINEAR; |
998 |
} |
|
999 |
SK_ABORT("Unknown filter"); |
|
1000 |
+ SkUNREACHABLE; |
|
1001 |
} |
|
1002 |
||
1003 |
static GrGLenum filter_to_gl_min_filter(GrSamplerState::Filter filter) { |
|
1164 | 1004 |
switch (filter) { |
1005 |
case GrSamplerState::Filter::kNearest: return GR_GL_NEAREST; |
|
1006 |
case GrSamplerState::Filter::kBilerp: return GR_GL_LINEAR; |
|
1162 | 1007 |
case GrSamplerState::Filter::kMipMap: return GR_GL_LINEAR_MIPMAP_LINEAR; |
1008 |
} |
|
1009 |
SK_ABORT("Unknown filter"); |
|
1010 |
+ SkUNREACHABLE; |
|
1011 |
} |
|
1012 |
||
1013 |
static inline GrGLenum wrap_mode_to_gl_wrap(GrSamplerState::WrapMode wrapMode, |
|
1164 | 1014 |
const GrCaps& caps) { |
1015 |
switch (wrapMode) { |
|
1016 |
case GrSamplerState::WrapMode::kClamp: return GR_GL_CLAMP_TO_EDGE; |
|
1017 |
case GrSamplerState::WrapMode::kRepeat: return GR_GL_REPEAT; |
|
1018 |
case GrSamplerState::WrapMode::kMirrorRepeat: return GR_GL_MIRRORED_REPEAT; |
|
1019 |
case GrSamplerState::WrapMode::kClampToBorder: |
|
1020 |
// May not be supported but should have been caught earlier |
|
1021 |
SkASSERT(caps.clampToBorderSupport()); |
|
1162 | 1022 |
return GR_GL_CLAMP_TO_BORDER; |
1023 |
} |
|
1024 |
SK_ABORT("Unknown wrap mode"); |
|
1025 |
+ SkUNREACHABLE; |
|
1026 |
} |
|
1027 |
||
1028 |
/////////////////////////////////////////////////////////////////////////////// |
|
1164 | 1029 |
|
1030 |
class GrGLGpu::SamplerObjectCache { |
|
1031 |
public: |
|
1032 |
SamplerObjectCache(GrGLGpu* gpu) : fGpu(gpu) { |
|
1033 |
fNumTextureUnits = fGpu->glCaps().shaderCaps()->maxFragmentSamplers(); |
|
1034 |
@@ -1102,17 +1106,17 @@ static bool renderbuffer_storage_msaa(co |
|
1035 |
GL_ALLOC_CALL(ctx.interface(), |
|
1036 |
RenderbufferStorageMultisampleES2EXT(GR_GL_RENDERBUFFER, |
|
1037 |
sampleCount, |
|
1038 |
format, |
|
1039 |
width, height)); |
|
1162 | 1040 |
break; |
1041 |
case GrGLCaps::kNone_MSFBOType: |
|
1042 |
SK_ABORT("Shouldn't be here if we don't support multisampled renderbuffers."); |
|
1043 |
- break; |
|
1044 |
+ SkUNREACHABLE; |
|
1045 |
} |
|
1046 |
return (GR_GL_NO_ERROR == CHECK_ALLOC_ERROR(ctx.interface())); |
|
1047 |
} |
|
1164 | 1048 |
|
1049 |
bool GrGLGpu::createRenderTargetObjects(const GrGLTexture::Desc& desc, |
|
1050 |
int sampleCount, |
|
1051 |
GrGLRenderTarget::IDs* rtIDs) { |
|
1052 |
rtIDs->fMSColorRenderbufferID = 0; |
|
1053 |
@@ -2270,19 +2274,20 @@ static GrGLenum gr_primitive_type_to_gl_ |
|
1054 |
case GrPrimitiveType::kPoints: |
|
1055 |
return GR_GL_POINTS; |
|
1056 |
case GrPrimitiveType::kLines: |
|
1057 |
return GR_GL_LINES; |
|
1058 |
case GrPrimitiveType::kLineStrip: |
|
1162 | 1059 |
return GR_GL_LINE_STRIP; |
1060 |
case GrPrimitiveType::kPath: |
|
1061 |
SK_ABORT("non-mesh-based GrPrimitiveType"); |
|
1062 |
- return 0; |
|
1063 |
+ SkUNREACHABLE; |
|
1064 |
} |
|
1065 |
SK_ABORT("invalid GrPrimitiveType"); |
|
1066 |
+ SkUNREACHABLE; |
|
1067 |
} |
|
1068 |
||
1069 |
void GrGLGpu::sendMeshToGpu(GrPrimitiveType primitiveType, const GrBuffer* vertexBuffer, |
|
1164 | 1070 |
int vertexCount, int baseVertex) { |
1071 |
const GrGLenum glPrimType = gr_primitive_type_to_gl_mode(primitiveType); |
|
1072 |
if (this->glCaps().drawArraysBaseVertexIsBroken()) { |
|
1073 |
this->setupGeometry(nullptr, vertexBuffer, baseVertex, nullptr, 0, GrPrimitiveRestart::kNo); |
|
1074 |
GL_CALL(DrawArrays(glPrimType, 0, vertexCount)); |
|
1075 |
@@ -4001,17 +4006,18 @@ int GrGLGpu::TextureToCopyProgramIdx(GrT |
|
1076 |
switch (GrSLCombinedSamplerTypeForTextureType(texture->texturePriv().textureType())) { |
|
1077 |
case kTexture2DSampler_GrSLType: |
|
1078 |
return 0; |
|
1079 |
case kTexture2DRectSampler_GrSLType: |
|
1080 |
return 1; |
|
1162 | 1081 |
case kTextureExternalSampler_GrSLType: |
1082 |
return 2; |
|
1083 |
default: |
|
1084 |
- SK_ABORT("Unexpected samper type"); |
|
1085 |
+ SK_ABORT("Unexpected sampler type"); |
|
1086 |
+ SkUNREACHABLE; |
|
1087 |
} |
|
1088 |
} |
|
1089 |
||
1164 | 1090 |
#ifdef SK_ENABLE_DUMP_GPU |
1091 |
#include "src/utils/SkJSONWriter.h" |
|
1092 |
void GrGLGpu::onDumpJSON(SkJSONWriter* writer) const { |
|
1093 |
// We are called by the base class, which has already called beginObject(). We choose to nest |
|
1094 |
// all of our caps information in a named sub-object. |
|
1162 | 1095 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp |
1096 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp |
|
1097 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLPath.cpp |
|
1164 | 1098 |
@@ -192,16 +192,17 @@ inline bool init_path_object_for_general |
1099 |
||
1100 |
/* |
|
1101 |
* For now paths only natively support winding and even odd fill types |
|
1102 |
*/ |
|
1103 |
static GrPathRendering::FillType convert_skpath_filltype(SkPath::FillType fill) { |
|
1162 | 1104 |
switch (fill) { |
1105 |
default: |
|
1106 |
SK_ABORT("Incomplete Switch\n"); |
|
1107 |
+ SkUNREACHABLE; |
|
1108 |
case SkPath::kWinding_FillType: |
|
1109 |
case SkPath::kInverseWinding_FillType: |
|
1110 |
return GrPathRendering::kWinding_FillType; |
|
1164 | 1111 |
case SkPath::kEvenOdd_FillType: |
1112 |
case SkPath::kInverseEvenOdd_FillType: |
|
1113 |
return GrPathRendering::kEvenOdd_FillType; |
|
1114 |
} |
|
1115 |
} |
|
1162 | 1116 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp |
1117 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp |
|
1118 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLTexture.cpp |
|
1164 | 1119 |
@@ -20,30 +20,33 @@ GrTextureType GrGLTexture::TextureTypeFr |
1120 |
case GR_GL_TEXTURE_2D: |
|
1121 |
return GrTextureType::k2D; |
|
1122 |
case GR_GL_TEXTURE_RECTANGLE: |
|
1123 |
return GrTextureType::kRectangle; |
|
1124 |
case GR_GL_TEXTURE_EXTERNAL: |
|
1162 | 1125 |
return GrTextureType::kExternal; |
1126 |
} |
|
1127 |
SK_ABORT("Unexpected texture target"); |
|
1128 |
+ SkUNREACHABLE; |
|
1129 |
} |
|
1130 |
||
1131 |
static inline GrGLenum target_from_texture_type(GrTextureType type) { |
|
1164 | 1132 |
switch (type) { |
1133 |
case GrTextureType::k2D: |
|
1134 |
return GR_GL_TEXTURE_2D; |
|
1135 |
case GrTextureType::kRectangle: |
|
1136 |
return GR_GL_TEXTURE_RECTANGLE; |
|
1137 |
case GrTextureType::kExternal: |
|
1162 | 1138 |
return GR_GL_TEXTURE_EXTERNAL; |
1139 |
default: |
|
1140 |
SK_ABORT("Unexpected texture target"); |
|
1141 |
+ SkUNREACHABLE; |
|
1142 |
} |
|
1143 |
SK_ABORT("Unexpected texture type"); |
|
1144 |
+ SkUNREACHABLE; |
|
1145 |
} |
|
1146 |
||
1147 |
// Because this class is virtually derived from GrSurface we must explicitly call its constructor. |
|
1164 | 1148 |
GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const Desc& desc, |
1149 |
GrMipMapsStatus mipMapsStatus) |
|
1150 |
: GrSurface(gpu, desc.fSize, desc.fConfig, GrProtected::kNo) |
|
1151 |
, INHERITED(gpu, desc.fSize, desc.fConfig, GrProtected::kNo, |
|
1152 |
TextureTypeFromTarget(desc.fTarget), mipMapsStatus) |
|
1162 | 1153 |
diff --git a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp |
1154 |
--- a/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp |
|
1155 |
+++ b/gfx/skia/skia/src/gpu/gl/GrGLVertexArray.cpp |
|
1164 | 1156 |
@@ -75,16 +75,17 @@ static AttribLayout attrib_layout(GrVert |
1157 |
case kUint_GrVertexAttribType: |
|
1158 |
return {false, 1, GR_GL_UNSIGNED_INT}; |
|
1159 |
case kUShort_norm_GrVertexAttribType: |
|
1160 |
return {true, 1, GR_GL_UNSIGNED_SHORT}; |
|
1161 |
case kUShort4_norm_GrVertexAttribType: |
|
1162 | 1162 |
return {true, 4, GR_GL_UNSIGNED_SHORT}; |
1163 |
} |
|
1164 |
SK_ABORT("Unknown vertex attrib type"); |
|
1165 |
+ SkUNREACHABLE; |
|
1166 |
}; |
|
1167 |
||
1168 |
void GrGLAttribArrayState::set(GrGLGpu* gpu, |
|
1164 | 1169 |
int index, |
1170 |
const GrBuffer* vertexBuffer, |
|
1171 |
GrVertexAttribType cpuType, |
|
1172 |
GrSLType gpuType, |
|
1173 |
GrGLsizei stride, |
|
1162 | 1174 |
diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp |
1175 |
--- a/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp |
|
1176 |
+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSL.cpp |
|
1164 | 1177 |
@@ -93,9 +93,10 @@ const char* GrGLSLTypeString(GrSLType t) |
1178 |
case kUByte4_GrSLType: |
|
1179 |
return "ubyte4"; |
|
1180 |
case kTexture2D_GrSLType: |
|
1181 |
return "texture2D"; |
|
1182 |
case kSampler_GrSLType: |
|
1162 | 1183 |
return "sampler"; |
1184 |
} |
|
1185 |
SK_ABORT("Unknown shader var type."); |
|
1186 |
+ SkUNREACHABLE; |
|
1187 |
} |
|
1188 |
diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp |
|
1189 |
--- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp |
|
1190 |
+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVarying.cpp |
|
1164 | 1191 |
@@ -30,16 +30,17 @@ static bool use_flat_interpolation(GrGLS |
1192 |
SkASSERT(!shaderCaps.preferFlatInterpolation() || |
|
1193 |
shaderCaps.flatInterpolationSupport()); |
|
1194 |
return shaderCaps.preferFlatInterpolation(); |
|
1195 |
case Interpolation::kMustBeFlat: |
|
1196 |
SkASSERT(shaderCaps.flatInterpolationSupport()); |
|
1162 | 1197 |
return true; |
1198 |
} |
|
1199 |
SK_ABORT("Invalid interpolation"); |
|
1200 |
+ SkUNREACHABLE; |
|
1201 |
} |
|
1202 |
||
1203 |
void GrGLSLVaryingHandler::addVarying(const char* name, GrGLSLVarying* varying, |
|
1164 | 1204 |
Interpolation interpolation) { |
1205 |
SkASSERT(GrSLTypeIsFloatType(varying->type()) || Interpolation::kMustBeFlat == interpolation); |
|
1206 |
bool willUseGeoShader = fProgramBuilder->primitiveProcessor().willUseGeoShader(); |
|
1207 |
VaryingInfo& v = fVaryings.push_back(); |
|
1208 |
||
1162 | 1209 |
diff --git a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp |
1210 |
--- a/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp |
|
1211 |
+++ b/gfx/skia/skia/src/gpu/glsl/GrGLSLVertexGeoBuilder.cpp |
|
1164 | 1212 |
@@ -46,26 +46,28 @@ void GrGLSLVertexBuilder::onFinalize() { |
1213 |
static const char* input_type_name(GrGLSLGeometryBuilder::InputType in) { |
|
1214 |
using InputType = GrGLSLGeometryBuilder::InputType; |
|
1215 |
switch (in) { |
|
1216 |
case InputType::kPoints: return "points"; |
|
1217 |
case InputType::kLines: return "lines"; |
|
1162 | 1218 |
case InputType::kTriangles: return "triangles"; |
1219 |
} |
|
1220 |
SK_ABORT("invalid input type"); |
|
1221 |
+ SkUNREACHABLE; |
|
1222 |
} |
|
1223 |
||
1224 |
static const char* output_type_name(GrGLSLGeometryBuilder::OutputType out) { |
|
1164 | 1225 |
using OutputType = GrGLSLGeometryBuilder::OutputType; |
1226 |
switch (out) { |
|
1227 |
case OutputType::kPoints: return "points"; |
|
1228 |
case OutputType::kLineStrip: return "line_strip"; |
|
1162 | 1229 |
case OutputType::kTriangleStrip: return "triangle_strip"; |
1230 |
} |
|
1231 |
SK_ABORT("invalid output type"); |
|
1232 |
+ SkUNREACHABLE; |
|
1233 |
} |
|
1234 |
||
1235 |
void GrGLSLGeometryBuilder::configure(InputType inputType, OutputType outputType, int maxVertices, |
|
1164 | 1236 |
int numInvocations) { |
1237 |
SkASSERT(!this->isConfigured()); |
|
1238 |
fNumInvocations = numInvocations; |
|
1239 |
this->addLayoutQualifier(input_type_name(inputType), kIn_InterfaceQualifier); |
|
1240 |
this->addLayoutQualifier(SkStringPrintf("invocations = %i", numInvocations).c_str(), |
|
1162 | 1241 |
diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm |
1242 |
--- a/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm |
|
1243 |
+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlCaps.mm |
|
1164 | 1244 |
@@ -501,16 +501,17 @@ size_t GrMtlCaps::GetFormatIndex(MTLPixe |
1245 |
static_assert(SK_ARRAY_COUNT(kMtlFormats) == GrMtlCaps::kNumMtlFormats, |
|
1246 |
"Size of kMtlFormats array must match static value in header"); |
|
1247 |
for (size_t i = 0; i < GrMtlCaps::kNumMtlFormats; ++i) { |
|
1248 |
if (kMtlFormats[i] == pixelFormat) { |
|
1249 |
return i; |
|
1162 | 1250 |
} |
1251 |
} |
|
1252 |
SK_ABORT("Invalid MTLPixelFormat"); |
|
1253 |
+ SkUNREACHABLE; |
|
1254 |
} |
|
1255 |
||
1256 |
void GrMtlCaps::initFormatTable() { |
|
1164 | 1257 |
FormatInfo* info; |
1258 |
||
1259 |
// Format: R8Unorm |
|
1260 |
{ |
|
1261 |
info = &fFormatTable[GetFormatIndex(MTLPixelFormatR8Unorm)]; |
|
1262 |
@@ -1006,16 +1007,17 @@ GrBackendFormat GrMtlCaps::getBackendFor |
|
1263 |
case SkImage::kETC1_CompressionType: |
|
1264 |
#ifdef SK_BUILD_FOR_MAC |
|
1265 |
return {}; |
|
1266 |
#else |
|
1267 |
return GrBackendFormat::MakeMtl(MTLPixelFormatETC2_RGB8); |
|
1162 | 1268 |
#endif |
1269 |
} |
|
1270 |
SK_ABORT("Invalid compression type"); |
|
1271 |
+ SkUNREACHABLE; |
|
1272 |
} |
|
1273 |
||
1274 |
GrSwizzle GrMtlCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const { |
|
1164 | 1275 |
MTLPixelFormat mtlFormat = GrBackendFormatAsMTLPixelFormat(format); |
1276 |
SkASSERT(mtlFormat != MTLPixelFormatInvalid); |
|
1277 |
const auto& info = this->getFormatInfo(mtlFormat); |
|
1278 |
for (int i = 0; i < info.fColorTypeInfoCount; ++i) { |
|
1279 |
const auto& ctInfo = info.fColorTypeInfos[i]; |
|
1162 | 1280 |
diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm |
1281 |
--- a/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm |
|
1282 |
+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlPipelineStateBuilder.mm |
|
1164 | 1283 |
@@ -150,16 +150,17 @@ static inline MTLVertexFormat attribute_ |
1284 |
return MTLVertexFormatUShortNormalized; |
|
1285 |
} else { |
|
1286 |
return MTLVertexFormatInvalid; |
|
1287 |
} |
|
1288 |
case kUShort4_norm_GrVertexAttribType: |
|
1162 | 1289 |
return MTLVertexFormatUShort4Normalized; |
1290 |
} |
|
1291 |
SK_ABORT("Unknown vertex attribute type"); |
|
1292 |
+ SkUNREACHABLE; |
|
1293 |
} |
|
1294 |
||
1295 |
static MTLVertexDescriptor* create_vertex_descriptor(const GrPrimitiveProcessor& primProc) { |
|
1164 | 1296 |
uint32_t vertexBinding = 0, instanceBinding = 0; |
1297 |
||
1298 |
int nextBinding = GrMtlUniformHandler::kLastUniformBinding + 1; |
|
1299 |
if (primProc.hasVertexAttributes()) { |
|
1300 |
vertexBinding = nextBinding++; |
|
1301 |
@@ -271,16 +272,17 @@ static MTLBlendFactor blend_coeff_to_mtl |
|
1302 |
} else { |
|
1303 |
return MTLBlendFactorZero; |
|
1304 |
} |
|
1305 |
case kIllegal_GrBlendCoeff: |
|
1306 |
return MTLBlendFactorZero; |
|
1162 | 1307 |
} |
1308 |
||
1309 |
SK_ABORT("Unknown blend coefficient"); |
|
1310 |
+ SkUNREACHABLE; |
|
1311 |
} |
|
1312 |
||
1313 |
static MTLBlendOperation blend_equation_to_mtl_blend_op(GrBlendEquation equation) { |
|
1164 | 1314 |
static const MTLBlendOperation gTable[] = { |
1315 |
MTLBlendOperationAdd, // kAdd_GrBlendEquation |
|
1316 |
MTLBlendOperationSubtract, // kSubtract_GrBlendEquation |
|
1317 |
MTLBlendOperationReverseSubtract, // kReverseSubtract_GrBlendEquation |
|
1318 |
}; |
|
1162 | 1319 |
diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm |
1320 |
--- a/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm |
|
1321 |
+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlSampler.mm |
|
1164 | 1322 |
@@ -33,16 +33,17 @@ static inline MTLSamplerAddressMode wrap |
1323 |
} else |
|
1324 |
#endif |
|
1325 |
{ |
|
1326 |
SkASSERT(false); |
|
1327 |
return MTLSamplerAddressModeClampToEdge; |
|
1162 | 1328 |
} |
1329 |
} |
|
1330 |
SK_ABORT("Unknown wrap mode."); |
|
1331 |
+ SkUNREACHABLE; |
|
1332 |
} |
|
1333 |
||
1334 |
GrMtlSampler* GrMtlSampler::Create(const GrMtlGpu* gpu, const GrSamplerState& samplerState) { |
|
1164 | 1335 |
static MTLSamplerMinMagFilter mtlMinMagFilterModes[] = { |
1336 |
MTLSamplerMinMagFilterNearest, |
|
1337 |
MTLSamplerMinMagFilterLinear, |
|
1338 |
MTLSamplerMinMagFilterLinear |
|
1339 |
}; |
|
1162 | 1340 |
diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm |
1341 |
--- a/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm |
|
1342 |
+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUniformHandler.mm |
|
1164 | 1343 |
@@ -85,16 +85,17 @@ static uint32_t grsltype_to_alignment_ma |
1344 |
case kTexture2DSampler_GrSLType: |
|
1345 |
case kTextureExternalSampler_GrSLType: |
|
1346 |
case kTexture2DRectSampler_GrSLType: |
|
1347 |
case kSampler_GrSLType: |
|
1348 |
case kTexture2D_GrSLType: |
|
1162 | 1349 |
break; |
1350 |
} |
|
1351 |
SK_ABORT("Unexpected type"); |
|
1352 |
+ SkUNREACHABLE; |
|
1353 |
} |
|
1354 |
||
1355 |
/** Returns the size in bytes taken up in Metal buffers for GrSLTypes. */ |
|
1164 | 1356 |
static inline uint32_t grsltype_to_mtl_size(GrSLType type) { |
1357 |
switch(type) { |
|
1358 |
case kByte_GrSLType: |
|
1359 |
return sizeof(int8_t); |
|
1360 |
case kByte2_GrSLType: |
|
1361 |
@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_mtl_s |
|
1362 |
case kTexture2DSampler_GrSLType: |
|
1363 |
case kTextureExternalSampler_GrSLType: |
|
1364 |
case kTexture2DRectSampler_GrSLType: |
|
1365 |
case kSampler_GrSLType: |
|
1366 |
case kTexture2D_GrSLType: |
|
1162 | 1367 |
break; |
1368 |
} |
|
1369 |
SK_ABORT("Unexpected type"); |
|
1370 |
+ SkUNREACHABLE; |
|
1371 |
} |
|
1372 |
||
1373 |
// Given the current offset into the ubo, calculate the offset for the uniform we're trying to add |
|
1164 | 1374 |
// taking into consideration all alignment requirements. The uniformOffset is set to the offset for |
1375 |
// the new uniform, and currentOffset is updated to be the offset to the end of the new uniform. |
|
1376 |
static void get_ubo_aligned_offset(uint32_t* uniformOffset, |
|
1377 |
uint32_t* currentOffset, |
|
1378 |
uint32_t* maxAlignment, |
|
1162 | 1379 |
diff --git a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm |
1380 |
--- a/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm |
|
1381 |
+++ b/gfx/skia/skia/src/gpu/mtl/GrMtlUtil.mm |
|
1164 | 1382 |
@@ -107,16 +107,17 @@ bool GrPixelConfigToMTLFormat(GrPixelCon |
1383 |
case kRGBA_16161616_GrPixelConfig: |
|
1384 |
*format = MTLPixelFormatRGBA16Unorm; |
|
1385 |
return true; |
|
1386 |
case kRG_half_GrPixelConfig: |
|
1387 |
*format = MTLPixelFormatRG16Float; |
|
1162 | 1388 |
return true; |
1389 |
} |
|
1390 |
SK_ABORT("Unexpected config"); |
|
1391 |
+ SkUNREACHABLE; |
|
1392 |
} |
|
1393 |
||
1394 |
MTLTextureDescriptor* GrGetMTLTextureDescriptor(id<MTLTexture> mtlTexture) { |
|
1164 | 1395 |
MTLTextureDescriptor* texDesc = [[MTLTextureDescriptor alloc] init]; |
1396 |
texDesc.textureType = mtlTexture.textureType; |
|
1397 |
texDesc.pixelFormat = mtlTexture.pixelFormat; |
|
1398 |
texDesc.width = mtlTexture.width; |
|
1399 |
texDesc.height = mtlTexture.height; |
|
1162 | 1400 |
diff --git a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp |
1401 |
--- a/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp |
|
1402 |
+++ b/gfx/skia/skia/src/gpu/ops/GrDrawVerticesOp.cpp |
|
1164 | 1403 |
@@ -605,16 +605,17 @@ static uint32_t seed_vertices(GrPrimitiv |
1404 |
case GrPrimitiveType::kLines: |
|
1405 |
case GrPrimitiveType::kLineStrip: |
|
1406 |
return 2; |
|
1407 |
case GrPrimitiveType::kPath: |
|
1408 |
SkASSERT(0); |
|
1162 | 1409 |
return 0; |
1410 |
} |
|
1411 |
SK_ABORT("Incomplete switch\n"); |
|
1412 |
+ SkUNREACHABLE; |
|
1413 |
} |
|
1414 |
||
1415 |
static uint32_t primitive_vertices(GrPrimitiveType type) { |
|
1164 | 1416 |
switch (type) { |
1417 |
case GrPrimitiveType::kTriangles: |
|
1418 |
return 3; |
|
1419 |
case GrPrimitiveType::kLines: |
|
1420 |
return 2; |
|
1421 |
@@ -622,16 +623,17 @@ static uint32_t primitive_vertices(GrPri |
|
1422 |
case GrPrimitiveType::kPoints: |
|
1423 |
case GrPrimitiveType::kLineStrip: |
|
1424 |
return 1; |
|
1425 |
case GrPrimitiveType::kPath: |
|
1426 |
SkASSERT(0); |
|
1162 | 1427 |
return 0; |
1428 |
} |
|
1429 |
SK_ABORT("Incomplete switch\n"); |
|
1430 |
+ SkUNREACHABLE; |
|
1431 |
} |
|
1432 |
||
1433 |
static SkPoint random_point(SkRandom* random, SkScalar min, SkScalar max) { |
|
1164 | 1434 |
SkPoint p; |
1435 |
p.fX = random->nextRangeScalar(min, max); |
|
1436 |
p.fY = random->nextRangeScalar(min, max); |
|
1437 |
return p; |
|
1438 |
} |
|
1162 | 1439 |
diff --git a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp |
1440 |
--- a/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp |
|
1441 |
+++ b/gfx/skia/skia/src/gpu/ops/GrFillRRectOp.cpp |
|
1164 | 1442 |
@@ -818,9 +818,10 @@ static bool can_use_hw_derivatives_with_ |
1443 |
if (!can_use_hw_derivatives_with_coverage(devScale, rrect.radii(corner))) { |
|
1444 |
return false; |
|
1445 |
} |
|
1446 |
} |
|
1447 |
return true; |
|
1162 | 1448 |
} |
1449 |
} |
|
1450 |
SK_ABORT("Invalid round rect type."); |
|
1451 |
+ SkUNREACHABLE; |
|
1452 |
} |
|
1453 |
diff --git a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp |
|
1454 |
--- a/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp |
|
1455 |
+++ b/gfx/skia/skia/src/gpu/ops/GrOvalOpFactory.cpp |
|
1164 | 1456 |
@@ -2278,39 +2278,42 @@ static int rrect_type_to_vert_count(RRec |
1457 |
switch (type) { |
|
1458 |
case kFill_RRectType: |
|
1459 |
case kStroke_RRectType: |
|
1460 |
return kVertsPerStandardRRect; |
|
1461 |
case kOverstroke_RRectType: |
|
1162 | 1462 |
return kVertsPerOverstrokeRRect; |
1463 |
} |
|
1464 |
SK_ABORT("Invalid type"); |
|
1465 |
+ SkUNREACHABLE; |
|
1466 |
} |
|
1467 |
||
1468 |
static int rrect_type_to_index_count(RRectType type) { |
|
1164 | 1469 |
switch (type) { |
1470 |
case kFill_RRectType: |
|
1471 |
return kIndicesPerFillRRect; |
|
1472 |
case kStroke_RRectType: |
|
1473 |
return kIndicesPerStrokeRRect; |
|
1474 |
case kOverstroke_RRectType: |
|
1162 | 1475 |
return kIndicesPerOverstrokeRRect; |
1476 |
} |
|
1477 |
SK_ABORT("Invalid type"); |
|
1478 |
+ SkUNREACHABLE; |
|
1479 |
} |
|
1480 |
||
1481 |
static const uint16_t* rrect_type_to_indices(RRectType type) { |
|
1164 | 1482 |
switch (type) { |
1483 |
case kFill_RRectType: |
|
1484 |
case kStroke_RRectType: |
|
1485 |
return gStandardRRectIndices; |
|
1486 |
case kOverstroke_RRectType: |
|
1162 | 1487 |
return gOverstrokeRRectIndices; |
1488 |
} |
|
1489 |
SK_ABORT("Invalid type"); |
|
1490 |
+ SkUNREACHABLE; |
|
1491 |
} |
|
1492 |
||
1493 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
1164 | 1494 |
|
1495 |
// For distance computations in the interior of filled rrects we: |
|
1496 |
// |
|
1497 |
// add a interior degenerate (point or line) rect |
|
1498 |
// each vertex of that rect gets -outerRad as its radius |
|
1162 | 1499 |
diff --git a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp |
1500 |
--- a/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp |
|
1501 |
+++ b/gfx/skia/skia/src/gpu/ops/GrShadowRRectOp.cpp |
|
1164 | 1502 |
@@ -150,39 +150,42 @@ static int rrect_type_to_vert_count(RRec |
1503 |
case kFill_RRectType: |
|
1504 |
return kVertsPerFillRRect; |
|
1505 |
case kStroke_RRectType: |
|
1506 |
return kVertsPerStrokeRRect; |
|
1507 |
case kOverstroke_RRectType: |
|
1162 | 1508 |
return kVertsPerOverstrokeRRect; |
1509 |
} |
|
1510 |
SK_ABORT("Invalid type"); |
|
1511 |
+ SkUNREACHABLE; |
|
1512 |
} |
|
1513 |
||
1514 |
static int rrect_type_to_index_count(RRectType type) { |
|
1164 | 1515 |
switch (type) { |
1516 |
case kFill_RRectType: |
|
1517 |
return kIndicesPerFillRRect; |
|
1518 |
case kStroke_RRectType: |
|
1519 |
return kIndicesPerStrokeRRect; |
|
1520 |
case kOverstroke_RRectType: |
|
1162 | 1521 |
return kIndicesPerOverstrokeRRect; |
1522 |
} |
|
1523 |
SK_ABORT("Invalid type"); |
|
1524 |
+ SkUNREACHABLE; |
|
1525 |
} |
|
1526 |
||
1527 |
static const uint16_t* rrect_type_to_indices(RRectType type) { |
|
1164 | 1528 |
switch (type) { |
1529 |
case kFill_RRectType: |
|
1530 |
case kStroke_RRectType: |
|
1531 |
return gRRectIndices + 6*4; |
|
1532 |
case kOverstroke_RRectType: |
|
1162 | 1533 |
return gRRectIndices; |
1534 |
} |
|
1535 |
SK_ABORT("Invalid type"); |
|
1536 |
+ SkUNREACHABLE; |
|
1537 |
} |
|
1538 |
||
1539 |
/////////////////////////////////////////////////////////////////////////////// |
|
1164 | 1540 |
namespace { |
1541 |
||
1542 |
class ShadowCircularRRectOp final : public GrMeshDrawOp { |
|
1543 |
public: |
|
1544 |
DEFINE_OP_CLASS_ID |
|
1162 | 1545 |
diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlob.h b/gfx/skia/skia/src/gpu/text/GrTextBlob.h |
1546 |
--- a/gfx/skia/skia/src/gpu/text/GrTextBlob.h |
|
1547 |
+++ b/gfx/skia/skia/src/gpu/text/GrTextBlob.h |
|
1164 | 1548 |
@@ -120,16 +120,17 @@ public: |
1549 |
} |
|
1550 |
||
1551 |
void operator delete(void* p) { |
|
1552 |
::operator delete(p); |
|
1553 |
} |
|
1162 | 1554 |
|
1555 |
void* operator new(size_t) { |
|
1556 |
SK_ABORT("All blobs are created by placement new."); |
|
1557 |
+ SkUNREACHABLE; |
|
1558 |
} |
|
1559 |
||
1560 |
void* operator new(size_t, void* p) { return p; } |
|
1164 | 1561 |
|
1562 |
bool hasDistanceField() const { return SkToBool(fTextType & kHasDistanceField_TextType); } |
|
1563 |
bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); } |
|
1564 |
void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; } |
|
1565 |
void setHasBitmap() { fTextType |= kHasBitmap_TextType; } |
|
1162 | 1566 |
diff --git a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp |
1567 |
--- a/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp |
|
1568 |
+++ b/gfx/skia/skia/src/gpu/text/GrTextBlobVertexRegenerator.cpp |
|
1164 | 1569 |
@@ -279,9 +279,10 @@ bool GrTextBlob::VertexRegenerator::rege |
1570 |
// set use tokens for all of the glyphs in our subrun. This is only valid if we |
|
1571 |
// have a valid atlas generation |
|
1572 |
fFullAtlasManager->setUseTokenBulk(*fSubRun->bulkUseToken(), |
|
1573 |
fUploadTarget->tokenTracker()->nextDrawToken(), |
|
1574 |
fSubRun->maskFormat()); |
|
1162 | 1575 |
return true; |
1576 |
} |
|
1577 |
SK_ABORT("Should not get here"); |
|
1578 |
+ SkUNREACHABLE; |
|
1579 |
} |
|
1580 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp |
|
1581 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp |
|
1582 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkCaps.cpp |
|
1164 | 1583 |
@@ -103,16 +103,17 @@ static FormatCompatibilityClass format_c |
1584 |
case VK_FORMAT_R8G8B8_UNORM: |
|
1585 |
return FormatCompatibilityClass::k24_3_1; |
|
1586 |
||
1587 |
case VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK: |
|
1588 |
return FormatCompatibilityClass::kETC2_RGB_8_16; |
|
1162 | 1589 |
|
1590 |
default: |
|
1591 |
SK_ABORT("Unsupported VkFormat"); |
|
1592 |
+ SkUNREACHABLE; |
|
1593 |
} |
|
1594 |
} |
|
1595 |
||
1164 | 1596 |
bool GrVkCaps::canCopyImage(VkFormat dstFormat, int dstSampleCnt, bool dstHasYcbcr, |
1597 |
VkFormat srcFormat, int srcSampleCnt, bool srcHasYcbcr) const { |
|
1598 |
if ((dstSampleCnt > 1 || srcSampleCnt > 1) && dstSampleCnt != srcSampleCnt) { |
|
1599 |
return false; |
|
1600 |
} |
|
1601 |
@@ -1651,16 +1652,17 @@ GrBackendFormat GrVkCaps::onGetDefaultBa |
|
1602 |
||
1603 |
GrBackendFormat GrVkCaps::getBackendFormatFromCompressionType( |
|
1604 |
SkImage::CompressionType compressionType) const { |
|
1605 |
switch (compressionType) { |
|
1606 |
case SkImage::kETC1_CompressionType: |
|
1162 | 1607 |
return GrBackendFormat::MakeVk(VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK); |
1608 |
} |
|
1609 |
SK_ABORT("Invalid compression type"); |
|
1610 |
+ SkUNREACHABLE; |
|
1611 |
} |
|
1612 |
||
1613 |
GrSwizzle GrVkCaps::getTextureSwizzle(const GrBackendFormat& format, GrColorType colorType) const { |
|
1164 | 1614 |
VkFormat vkFormat; |
1615 |
SkAssertResult(format.asVkFormat(&vkFormat)); |
|
1616 |
const auto& info = this->getFormatInfo(vkFormat); |
|
1617 |
for (int i = 0; i < info.fColorTypeInfoCount; ++i) { |
|
1618 |
const auto& ctInfo = info.fColorTypeInfos[i]; |
|
1162 | 1619 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp |
1620 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp |
|
1621 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkMemory.cpp |
|
1164 | 1622 |
@@ -23,16 +23,17 @@ static BufferUsage get_buffer_usage(GrVk |
1623 |
case GrVkBuffer::kUniform_Type: |
|
1624 |
SkASSERT(dynamic); |
|
1625 |
return BufferUsage::kCpuWritesGpuReads; |
|
1626 |
case GrVkBuffer::kCopyRead_Type: // fall through |
|
1627 |
case GrVkBuffer::kCopyWrite_Type: |
|
1162 | 1628 |
return BufferUsage::kCpuOnly; |
1629 |
} |
|
1630 |
SK_ABORT("Invalid GrVkBuffer::Type"); |
|
1631 |
+ SkUNREACHABLE; |
|
1632 |
} |
|
1633 |
||
1634 |
bool GrVkMemory::AllocAndBindBufferMemory(const GrVkGpu* gpu, |
|
1164 | 1635 |
VkBuffer buffer, |
1636 |
GrVkBuffer::Type type, |
|
1637 |
bool dynamic, |
|
1638 |
GrVkAlloc* alloc) { |
|
1639 |
GrVkMemoryAllocator* allocator = gpu->memoryAllocator(); |
|
1162 | 1640 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp |
1641 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp |
|
1642 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkPipeline.cpp |
|
1164 | 1643 |
@@ -75,16 +75,17 @@ static inline VkFormat attrib_type_to_vk |
1644 |
case kUint_GrVertexAttribType: |
|
1645 |
return VK_FORMAT_R32_UINT; |
|
1646 |
case kUShort_norm_GrVertexAttribType: |
|
1647 |
return VK_FORMAT_R16_UNORM; |
|
1648 |
case kUShort4_norm_GrVertexAttribType: |
|
1162 | 1649 |
return VK_FORMAT_R16G16B16A16_UNORM; |
1650 |
} |
|
1651 |
SK_ABORT("Unknown vertex attrib type"); |
|
1652 |
+ SkUNREACHABLE; |
|
1653 |
} |
|
1654 |
||
1655 |
static void setup_vertex_input_state(const GrPrimitiveProcessor& primProc, |
|
1164 | 1656 |
VkPipelineVertexInputStateCreateInfo* vertexInputInfo, |
1657 |
SkSTArray<2, VkVertexInputBindingDescription, true>* bindingDescs, |
|
1658 |
VkVertexInputAttributeDescription* attributeDesc) { |
|
1659 |
uint32_t vertexBinding = 0, instanceBinding = 0; |
|
1660 |
||
1661 |
@@ -157,18 +158,20 @@ static VkPrimitiveTopology gr_primitive_ |
|
1662 |
case GrPrimitiveType::kPoints: |
|
1663 |
return VK_PRIMITIVE_TOPOLOGY_POINT_LIST; |
|
1664 |
case GrPrimitiveType::kLines: |
|
1665 |
return VK_PRIMITIVE_TOPOLOGY_LINE_LIST; |
|
1666 |
case GrPrimitiveType::kLineStrip: |
|
1162 | 1667 |
return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; |
1668 |
case GrPrimitiveType::kPath: |
|
1669 |
SK_ABORT("Unsupported primitive type"); |
|
1670 |
+ SkUNREACHABLE; |
|
1671 |
} |
|
1672 |
SK_ABORT("invalid GrPrimitiveType"); |
|
1673 |
+ SkUNREACHABLE; |
|
1674 |
} |
|
1675 |
||
1676 |
static void setup_input_assembly_state(GrPrimitiveType primitiveType, |
|
1164 | 1677 |
VkPipelineInputAssemblyStateCreateInfo* inputAssemblyInfo) { |
1678 |
memset(inputAssemblyInfo, 0, sizeof(VkPipelineInputAssemblyStateCreateInfo)); |
|
1679 |
inputAssemblyInfo->sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO; |
|
1680 |
inputAssemblyInfo->pNext = nullptr; |
|
1681 |
inputAssemblyInfo->flags = 0; |
|
1162 | 1682 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp |
1683 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp |
|
1684 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkSampler.cpp |
|
1164 | 1685 |
@@ -18,16 +18,17 @@ static inline VkSamplerAddressMode wrap_ |
1686 |
case GrSamplerState::WrapMode::kRepeat: |
|
1687 |
return VK_SAMPLER_ADDRESS_MODE_REPEAT; |
|
1688 |
case GrSamplerState::WrapMode::kMirrorRepeat: |
|
1689 |
return VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT; |
|
1690 |
case GrSamplerState::WrapMode::kClampToBorder: |
|
1162 | 1691 |
return VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER; |
1692 |
} |
|
1693 |
SK_ABORT("Unknown wrap mode."); |
|
1694 |
+ SkUNREACHABLE; |
|
1695 |
} |
|
1696 |
||
1697 |
GrVkSampler* GrVkSampler::Create(GrVkGpu* gpu, const GrSamplerState& samplerState, |
|
1164 | 1698 |
const GrVkYcbcrConversionInfo& ycbcrInfo) { |
1699 |
static VkFilter vkMinFilterModes[] = { |
|
1700 |
VK_FILTER_NEAREST, |
|
1701 |
VK_FILTER_LINEAR, |
|
1702 |
VK_FILTER_LINEAR |
|
1162 | 1703 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h |
1704 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h |
|
1705 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkTransferBuffer.h |
|
1164 | 1706 |
@@ -29,16 +29,17 @@ private: |
1707 |
const SkString& dumpName) const override; |
|
1708 |
||
1709 |
void onMap() override { this->GrGpuBuffer::fMapPtr = this->vkMap(this->getVkGpu()); } |
|
1710 |
||
1711 |
void onUnmap() override { this->vkUnmap(this->getVkGpu()); } |
|
1162 | 1712 |
|
1713 |
bool onUpdateData(const void* src, size_t srcSizeInBytes) override { |
|
1714 |
SK_ABORT("Not implemented for transfer buffers."); |
|
1715 |
+ SkUNREACHABLE; |
|
1716 |
} |
|
1717 |
||
1718 |
GrVkGpu* getVkGpu() const { |
|
1164 | 1719 |
SkASSERT(!this->wasDestroyed()); |
1720 |
return reinterpret_cast<GrVkGpu*>(this->getGpu()); |
|
1721 |
} |
|
1722 |
||
1723 |
typedef GrGpuBuffer INHERITED; |
|
1162 | 1724 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp |
1725 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp |
|
1726 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkUniformHandler.cpp |
|
1164 | 1727 |
@@ -84,16 +84,17 @@ static uint32_t grsltype_to_alignment_ma |
1728 |
case kTexture2DSampler_GrSLType: |
|
1729 |
case kTextureExternalSampler_GrSLType: |
|
1730 |
case kTexture2DRectSampler_GrSLType: |
|
1731 |
case kSampler_GrSLType: |
|
1732 |
case kTexture2D_GrSLType: |
|
1162 | 1733 |
break; |
1734 |
} |
|
1735 |
SK_ABORT("Unexpected type"); |
|
1736 |
+ SkUNREACHABLE; |
|
1737 |
} |
|
1738 |
||
1739 |
/** Returns the size in bytes taken up in vulkanbuffers for GrSLTypes. */ |
|
1164 | 1740 |
static inline uint32_t grsltype_to_vk_size(GrSLType type) { |
1741 |
switch(type) { |
|
1742 |
case kByte_GrSLType: |
|
1743 |
return sizeof(int8_t); |
|
1744 |
case kByte2_GrSLType: |
|
1745 |
@@ -167,16 +168,17 @@ static inline uint32_t grsltype_to_vk_si |
|
1746 |
case kTexture2DSampler_GrSLType: |
|
1747 |
case kTextureExternalSampler_GrSLType: |
|
1748 |
case kTexture2DRectSampler_GrSLType: |
|
1749 |
case kSampler_GrSLType: |
|
1750 |
case kTexture2D_GrSLType: |
|
1162 | 1751 |
break; |
1752 |
} |
|
1753 |
SK_ABORT("Unexpected type"); |
|
1754 |
+ SkUNREACHABLE; |
|
1755 |
} |
|
1756 |
||
1757 |
||
1164 | 1758 |
// Given the current offset into the ubo, calculate the offset for the uniform we're trying to add |
1759 |
// taking into consideration all alignment requirements. The uniformOffset is set to the offset for |
|
1760 |
// the new uniform, and currentOffset is updated to be the offset to the end of the new uniform. |
|
1761 |
static void get_ubo_aligned_offset(uint32_t* uniformOffset, |
|
1762 |
uint32_t* currentOffset, |
|
1162 | 1763 |
diff --git a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp |
1764 |
--- a/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp |
|
1765 |
+++ b/gfx/skia/skia/src/gpu/vk/GrVkVaryingHandler.cpp |
|
1164 | 1766 |
@@ -69,16 +69,17 @@ static inline int grsltype_to_location_s |
1767 |
case kByte_GrSLType: |
|
1768 |
return 1; |
|
1769 |
case kUint_GrSLType: // fall through |
|
1770 |
case kUShort_GrSLType: |
|
1771 |
case kUByte_GrSLType: |
|
1162 | 1772 |
return 1; |
1773 |
} |
|
1774 |
SK_ABORT("Unexpected type"); |
|
1775 |
+ SkUNREACHABLE; |
|
1776 |
} |
|
1777 |
||
1778 |
static void finalize_helper(GrVkVaryingHandler::VarArray& vars) { |
|
1164 | 1779 |
int locationIndex = 0; |
1780 |
for (int i = 0; i < vars.count(); ++i) { |
|
1781 |
GrShaderVar& var = vars[i]; |
|
1782 |
SkString location; |
|
1783 |
location.appendf("location = %d", locationIndex); |
|
1162 | 1784 |
diff --git a/gfx/skia/skia/src/pdf/SkPDFTag.cpp b/gfx/skia/skia/src/pdf/SkPDFTag.cpp |
1785 |
--- a/gfx/skia/skia/src/pdf/SkPDFTag.cpp |
|
1786 |
+++ b/gfx/skia/skia/src/pdf/SkPDFTag.cpp |
|
1164 | 1787 |
@@ -59,16 +59,17 @@ static const char* tag_name_from_type(Sk |
1788 |
M(WT); |
|
1789 |
M(WP); |
|
1790 |
M(Figure); |
|
1791 |
M(Formula); |
|
1792 |
M(Form); |
|
1162 | 1793 |
#undef M |
1794 |
} |
|
1795 |
SK_ABORT("bad tag"); |
|
1796 |
+ SkUNREACHABLE; |
|
1797 |
} |
|
1798 |
||
1799 |
struct SkPDFTagNode { |
|
1164 | 1800 |
SkPDFTagNode* fChildren = nullptr; |
1801 |
size_t fChildCount = 0; |
|
1802 |
struct MarkedContentInfo { |
|
1803 |
unsigned fPageIndex; |
|
1804 |
int fMarkId; |
|
1162 | 1805 |
diff --git a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp |
1806 |
--- a/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp |
|
1807 |
+++ b/gfx/skia/skia/src/ports/SkFontMgr_FontConfigInterface.cpp |
|
1164 | 1808 |
@@ -168,28 +168,32 @@ public: |
1809 |
SkFontMgr_FCI(sk_sp<SkFontConfigInterface> fci) |
|
1810 |
: fFCI(std::move(fci)) |
|
1811 |
, fCache(kMaxSize) |
|
1812 |
{} |
|
1813 |
||
1162 | 1814 |
protected: |
1815 |
int onCountFamilies() const override { |
|
1816 |
SK_ABORT("Not implemented."); |
|
1817 |
+ SkUNREACHABLE; |
|
1818 |
} |
|
1819 |
||
1820 |
void onGetFamilyName(int index, SkString* familyName) const override { |
|
1821 |
SK_ABORT("Not implemented."); |
|
1822 |
+ SkUNREACHABLE; |
|
1823 |
} |
|
1824 |
||
1825 |
SkFontStyleSet* onCreateStyleSet(int index) const override { |
|
1826 |
SK_ABORT("Not implemented."); |
|
1827 |
+ SkUNREACHABLE; |
|
1828 |
} |
|
1829 |
||
1830 |
SkFontStyleSet* onMatchFamily(const char familyName[]) const override { |
|
1831 |
SK_ABORT("Not implemented."); |
|
1832 |
+ SkUNREACHABLE; |
|
1833 |
} |
|
1834 |
||
1835 |
SkTypeface* onMatchFamilyStyle(const char requestedFamilyName[], |
|
1164 | 1836 |
const SkFontStyle& requestedStyle) const override |
1837 |
{ |
|
1838 |
SkAutoMutexExclusive ama(fMutex); |
|
1839 |
||
1840 |
SkFontConfigInterface::FontIdentity identity; |
|
1841 |
@@ -210,20 +214,22 @@ protected: |
|
1842 |
} |
|
1843 |
return face.release(); |
|
1844 |
} |
|
1845 |
||
1846 |
SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&, |
|
1162 | 1847 |
const char* bcp47[], int bcp47Count, |
1848 |
SkUnichar character) const override { |
|
1849 |
SK_ABORT("Not implemented."); |
|
1850 |
+ SkUNREACHABLE; |
|
1851 |
} |
|
1852 |
||
1853 |
SkTypeface* onMatchFaceStyle(const SkTypeface*, const SkFontStyle&) const override { |
|
1854 |
SK_ABORT("Not implemented."); |
|
1855 |
+ SkUNREACHABLE; |
|
1856 |
} |
|
1857 |
||
1858 |
sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData> data, int ttcIndex) const override { |
|
1164 | 1859 |
return this->onMakeFromStreamIndex(SkMemoryStream::Make(std::move(data)), ttcIndex); |
1860 |
} |
|
1861 |
||
1862 |
sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset> stream, |
|
1863 |
int ttcIndex) const override { |
|
1162 | 1864 |
diff --git a/gfx/skia/skia/src/shaders/SkImageShader.cpp b/gfx/skia/skia/src/shaders/SkImageShader.cpp |
1865 |
--- a/gfx/skia/skia/src/shaders/SkImageShader.cpp |
|
1866 |
+++ b/gfx/skia/skia/src/shaders/SkImageShader.cpp |
|
1164 | 1867 |
@@ -178,16 +178,17 @@ static GrSamplerState::WrapMode tile_mod |
1868 |
case SkTileMode::kRepeat: |
|
1869 |
return GrSamplerState::WrapMode::kRepeat; |
|
1870 |
case SkTileMode::kMirror: |
|
1871 |
return GrSamplerState::WrapMode::kMirrorRepeat; |
|
1872 |
case SkTileMode::kDecal: |
|
1162 | 1873 |
return GrSamplerState::WrapMode::kClampToBorder; |
1874 |
} |
|
1875 |
SK_ABORT("Unknown tile mode."); |
|
1876 |
+ SkUNREACHABLE; |
|
1877 |
} |
|
1878 |
||
1879 |
std::unique_ptr<GrFragmentProcessor> SkImageShader::asFragmentProcessor( |
|
1164 | 1880 |
const GrFPArgs& args) const { |
1881 |
const auto lm = this->totalLocalMatrix(args.fPreLocalMatrix, args.fPostLocalMatrix); |
|
1882 |
SkMatrix lmInverse; |
|
1883 |
if (!lm->invert(&lmInverse)) { |
|
1884 |
return nullptr; |
|
1162 | 1885 |
diff --git a/gfx/skia/skia/src/utils/SkShadowUtils.cpp b/gfx/skia/skia/src/utils/SkShadowUtils.cpp |
1886 |
--- a/gfx/skia/skia/src/utils/SkShadowUtils.cpp |
|
1887 |
+++ b/gfx/skia/skia/src/utils/SkShadowUtils.cpp |
|
1164 | 1888 |
@@ -144,16 +144,17 @@ struct SpotVerticesFactory { |
1889 |
// if the offsets don't match. |
|
1890 |
if (fOffset == that.fOffset) { |
|
1891 |
translate->set(0, 0); |
|
1892 |
return true; |
|
1893 |
} |
|
1162 | 1894 |
return false; |
1895 |
} |
|
1896 |
SK_ABORT("Uninitialized occluder type?"); |
|
1897 |
+ SkUNREACHABLE; |
|
1898 |
} |
|
1899 |
||
1900 |
sk_sp<SkVertices> makeVertices(const SkPath& path, const SkMatrix& ctm, |
|
1164 | 1901 |
SkVector* translate) const { |
1902 |
bool transparent = OccluderType::kTransparent == fOccluderType; |
|
1903 |
SkPoint3 zParams = SkPoint3::Make(0, 0, fOccluderHeight); |
|
1904 |
if (ctm.hasPerspective() || OccluderType::kOpaquePartialUmbra == fOccluderType) { |
|
1905 |
translate->set(0, 0); |
|
1162 | 1906 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp |
1907 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp |
|
1908 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ast_to_hir.cpp |
|
1164 | 1909 |
@@ -2646,16 +2646,17 @@ get_type_name_for_precision_qualifier(co |
1910 |
unreachable("Unsupported sampler/image type"); |
|
1911 |
} /* sampler/image type */ |
|
1912 |
break; |
|
1913 |
} /* GLSL_TYPE_SAMPLER/GLSL_TYPE_IMAGE */ |
|
1914 |
break; |
|
1162 | 1915 |
default: |
1916 |
unreachable("Unsupported type"); |
|
1917 |
} /* base type */ |
|
1918 |
+ return ""; |
|
1919 |
} |
|
1920 |
||
1921 |
static unsigned |
|
1164 | 1922 |
select_gles_precision(unsigned qual_precision, |
1923 |
const glsl_type *type, |
|
1924 |
struct _mesa_glsl_parse_state *state, YYLTYPE *loc) |
|
1925 |
{ |
|
1926 |
/* Precision qualifiers do not have any meaning in Desktop GLSL. |
|
1162 | 1927 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp |
1928 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp |
|
1929 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/ir.cpp |
|
1164 | 1930 |
@@ -619,16 +619,17 @@ ir_expression::get_num_operands(ir_expre |
1931 |
||
1932 |
if (op <= ir_last_triop) |
|
1933 |
return 3; |
|
1934 |
||
1935 |
if (op <= ir_last_quadop) |
|
1162 | 1936 |
return 4; |
1937 |
||
1938 |
unreachable("Could not calculate number of operands"); |
|
1939 |
+ return -1; |
|
1940 |
} |
|
1941 |
||
1942 |
#include "ir_expression_operation_strings.h" |
|
1164 | 1943 |
|
1944 |
const char* |
|
1945 |
depth_layout_string(ir_depth_layout layout) |
|
1946 |
{ |
|
1947 |
switch(layout) { |
|
1162 | 1948 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp |
1949 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp |
|
1950 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/loop_analysis.cpp |
|
1164 | 1951 |
@@ -234,16 +234,17 @@ incremented_before_terminator(ir_loop *l |
1952 |
} |
|
1953 |
||
1954 |
default: |
|
1955 |
break; |
|
1956 |
} |
|
1162 | 1957 |
} |
1958 |
||
1959 |
unreachable("Unable to find induction variable"); |
|
1960 |
+ return false; |
|
1961 |
} |
|
1962 |
||
1963 |
/** |
|
1164 | 1964 |
* Record the fact that the given loop variable was referenced inside the loop. |
1965 |
* |
|
1966 |
* \arg in_assignee is true if the reference was on the LHS of an assignment. |
|
1967 |
* |
|
1968 |
* \arg in_conditional_code_or_nested_loop is true if the reference occurred |
|
1162 | 1969 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp |
1970 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp |
|
1971 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl/opt_vectorize.cpp |
|
1164 | 1972 |
@@ -224,16 +224,17 @@ write_mask_to_swizzle(unsigned write_mas |
1973 |
{ |
|
1974 |
switch (write_mask) { |
|
1975 |
case WRITEMASK_X: return SWIZZLE_X; |
|
1976 |
case WRITEMASK_Y: return SWIZZLE_Y; |
|
1977 |
case WRITEMASK_Z: return SWIZZLE_Z; |
|
1162 | 1978 |
case WRITEMASK_W: return SWIZZLE_W; |
1979 |
} |
|
1980 |
unreachable("not reached"); |
|
1981 |
+ return 0; |
|
1982 |
} |
|
1983 |
||
1984 |
/** |
|
1164 | 1985 |
* Returns whether a single-channeled write mask matches a swizzle. |
1986 |
*/ |
|
1987 |
static bool |
|
1988 |
write_mask_matches_swizzle(unsigned write_mask, |
|
1989 |
const ir_swizzle *swz) |
|
1162 | 1990 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp |
1991 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp |
|
1992 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/compiler/glsl_types.cpp |
|
1164 | 1993 |
@@ -455,16 +455,17 @@ const glsl_type *glsl_type::get_bare_typ |
1994 |
case GLSL_TYPE_VOID: |
|
1995 |
case GLSL_TYPE_SUBROUTINE: |
|
1996 |
case GLSL_TYPE_FUNCTION: |
|
1997 |
case GLSL_TYPE_ERROR: |
|
1998 |
return this; |
|
1162 | 1999 |
} |
2000 |
||
2001 |
unreachable("Invalid base type"); |
|
2002 |
+ return nullptr; |
|
2003 |
} |
|
2004 |
||
2005 |
const glsl_type *glsl_type::get_float16_type() const |
|
1164 | 2006 |
{ |
2007 |
assert(this->base_type == GLSL_TYPE_FLOAT); |
|
2008 |
||
2009 |
return get_instance(GLSL_TYPE_FLOAT16, |
|
2010 |
this->vector_elements, |
|
2011 |
@@ -2011,16 +2012,17 @@ glsl_type::get_explicit_std140_type(bool |
|
2012 |
(enum glsl_interface_packing)this->interface_packing, |
|
2013 |
this->interface_row_major, |
|
2014 |
this->name); |
|
2015 |
||
2016 |
delete[] fields; |
|
1162 | 2017 |
return type; |
2018 |
} else { |
|
2019 |
unreachable("Invalid type for UBO or SSBO"); |
|
2020 |
+ return nullptr; |
|
2021 |
} |
|
2022 |
} |
|
2023 |
||
1164 | 2024 |
unsigned |
2025 |
glsl_type::std430_base_alignment(bool row_major) const |
|
2026 |
{ |
|
2027 |
||
2028 |
unsigned N = is_64bit() ? 8 : 4; |
|
2029 |
@@ -2369,16 +2371,17 @@ glsl_type::get_explicit_std430_type(bool |
|
2030 |
(enum glsl_interface_packing)this->interface_packing, |
|
2031 |
this->interface_row_major, |
|
2032 |
this->name); |
|
2033 |
||
2034 |
delete[] fields; |
|
1162 | 2035 |
return type; |
2036 |
} else { |
|
2037 |
unreachable("Invalid type for SSBO"); |
|
2038 |
+ return nullptr; |
|
2039 |
} |
|
2040 |
} |
|
2041 |
||
1164 | 2042 |
const glsl_type * |
2043 |
glsl_type::get_explicit_interface_type(bool supports_std430) const |
|
2044 |
{ |
|
2045 |
enum glsl_interface_packing packing = |
|
2046 |
this->get_internal_ifc_packing(supports_std430); |
|
2047 |
@@ -2443,16 +2446,17 @@ glsl_type::get_explicit_type_for_size_al |
|
2048 |
unsigned stride = align(col_size, col_align); |
|
2049 |
||
2050 |
*size = this->matrix_columns * stride; |
|
2051 |
*alignment = col_align; |
|
2052 |
return glsl_type::get_instance(this->base_type, this->vector_elements, |
|
1162 | 2053 |
this->matrix_columns, stride, false); |
2054 |
} else { |
|
2055 |
unreachable("Unhandled type."); |
|
2056 |
+ return nullptr; |
|
2057 |
} |
|
2058 |
} |
|
2059 |
||
1164 | 2060 |
unsigned |
2061 |
glsl_type::count_vec4_slots(bool is_gl_vertex_input, bool is_bindless) const |
|
2062 |
{ |
|
2063 |
/* From page 31 (page 37 of the PDF) of the GLSL 1.50 spec: |
|
2064 |
* |
|
2065 |
@@ -2943,12 +2947,13 @@ glsl_get_sampler_dim_coordinate_componen |
|
2066 |
case GLSL_SAMPLER_DIM_SUBPASS: |
|
2067 |
case GLSL_SAMPLER_DIM_SUBPASS_MS: |
|
2068 |
return 2; |
|
2069 |
case GLSL_SAMPLER_DIM_3D: |
|
2070 |
case GLSL_SAMPLER_DIM_CUBE: |
|
1162 | 2071 |
return 3; |
2072 |
default: |
|
2073 |
unreachable("Unknown sampler dim"); |
|
2074 |
+ return -1; |
|
2075 |
} |
|
2076 |
} |
|
2077 |
||
1164 | 2078 |
} |
1162 | 2079 |
diff --git a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h |
2080 |
--- a/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h |
|
2081 |
+++ b/third_party/rust/glslopt/glsl-optimizer/src/mesa/main/shaderobj.h |
|
1164 | 2082 |
@@ -180,16 +180,17 @@ static inline gl_shader_stage |
2083 |
case GL_COMPUTE_SUBROUTINE_UNIFORM: |
|
2084 |
return MESA_SHADER_COMPUTE; |
|
2085 |
case GL_TESS_CONTROL_SUBROUTINE_UNIFORM: |
|
2086 |
return MESA_SHADER_TESS_CTRL; |
|
2087 |
case GL_TESS_EVALUATION_SUBROUTINE_UNIFORM: |
|
1162 | 2088 |
return MESA_SHADER_TESS_EVAL; |
2089 |
} |
|
2090 |
unreachable("not reached"); |
|
2091 |
+ return MESA_SHADER_NONE; |
|
2092 |
} |
|
2093 |
||
2094 |
static inline gl_shader_stage |
|
1164 | 2095 |
_mesa_shader_stage_from_subroutine(GLenum subroutine) |
2096 |
{ |
|
2097 |
switch (subroutine) { |
|
2098 |
case GL_VERTEX_SUBROUTINE: |
|
2099 |
return MESA_SHADER_VERTEX; |
|
2100 |
@@ -200,16 +201,17 @@ static inline gl_shader_stage |
|
2101 |
case GL_COMPUTE_SUBROUTINE: |
|
2102 |
return MESA_SHADER_COMPUTE; |
|
2103 |
case GL_TESS_CONTROL_SUBROUTINE: |
|
2104 |
return MESA_SHADER_TESS_CTRL; |
|
2105 |
case GL_TESS_EVALUATION_SUBROUTINE: |
|
1162 | 2106 |
return MESA_SHADER_TESS_EVAL; |
2107 |
} |
|
2108 |
unreachable("not reached"); |
|
2109 |
+ return MESA_SHADER_NONE; |
|
2110 |
} |
|
2111 |
||
2112 |
static inline GLenum |
|
1164 | 2113 |
_mesa_shader_stage_to_subroutine(gl_shader_stage stage) |
2114 |
{ |
|
2115 |
switch (stage) { |
|
2116 |
case MESA_SHADER_VERTEX: |
|
2117 |
return GL_VERTEX_SUBROUTINE; |
|
2118 |
@@ -225,16 +227,17 @@ static inline GLenum |
|
2119 |
return GL_TESS_EVALUATION_SUBROUTINE; |
|
2120 |
case MESA_SHADER_NONE: |
|
2121 |
break; |
|
2122 |
case MESA_SHADER_KERNEL: |
|
2123 |
unreachable("not reached"); |
|
1162 | 2124 |
break; |
2125 |
} |
|
2126 |
unreachable("not reached"); |
|
2127 |
+ return GL_VERTEX_PROGRAM_ARB; |
|
2128 |
} |
|
2129 |
||
2130 |
static inline GLenum |
|
1164 | 2131 |
_mesa_shader_stage_to_subroutine_uniform(gl_shader_stage stage) |
2132 |
{ |
|
2133 |
switch (stage) { |
|
2134 |
case MESA_SHADER_VERTEX: |
|
2135 |
return GL_VERTEX_SUBROUTINE_UNIFORM; |
|
2136 |
@@ -248,16 +251,17 @@ static inline GLenum |
|
2137 |
return GL_TESS_CONTROL_SUBROUTINE_UNIFORM; |
|
2138 |
case MESA_SHADER_TESS_EVAL: |
|
2139 |
return GL_TESS_EVALUATION_SUBROUTINE_UNIFORM; |
|
2140 |
case MESA_SHADER_NONE: |
|
2141 |
case MESA_SHADER_KERNEL: |
|
1162 | 2142 |
break; |
2143 |
} |
|
2144 |
unreachable("not reached"); |
|
2145 |
+ return GL_VERTEX_PROGRAM_ARB; |
|
2146 |
} |
|
2147 |
||
2148 |
extern bool |
|
1164 | 2149 |
_mesa_validate_pipeline_io(struct gl_pipeline_object *); |
2150 |
||
2151 |
#ifdef __cplusplus |
|
2152 |
} |
|
2153 |
#endif |