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