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