Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: src/gpu/GrOvalRenderer.cpp

Issue 617853003: Revert of Add isSingleComponent bool to getConstantColorComponent (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrOvalRenderer.h" 8 #include "GrOvalRenderer.h"
9 9
10 #include "gl/builders/GrGLFullProgramBuilder.h" 10 #include "gl/builders/GrGLFullProgramBuilder.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 if (stroke) { 69 if (stroke) {
70 gCircleStrokeEdge->ref(); 70 gCircleStrokeEdge->ref();
71 return gCircleStrokeEdge; 71 return gCircleStrokeEdge;
72 } else { 72 } else {
73 gCircleFillEdge->ref(); 73 gCircleFillEdge->ref();
74 return gCircleFillEdge; 74 return gCircleFillEdge;
75 } 75 }
76 } 76 }
77 77
78 virtual void getConstantColorComponents(GrColor* color,
79 uint32_t* validFlags) const SK_OVERR IDE {
80 *validFlags = 0;
81 }
82
78 const GrShaderVar& inCircleEdge() const { return fInCircleEdge; } 83 const GrShaderVar& inCircleEdge() const { return fInCircleEdge; }
79 84
80 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE { 85 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE {
81 return GrTBackendGeometryProcessorFactory<CircleEdgeEffect>::getInstance (); 86 return GrTBackendGeometryProcessorFactory<CircleEdgeEffect>::getInstance ();
82 } 87 }
83 88
84 virtual ~CircleEdgeEffect() {} 89 virtual ~CircleEdgeEffect() {}
85 90
86 static const char* Name() { return "CircleEdge"; } 91 static const char* Name() { return "CircleEdge"; }
87 92
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 kVec4f_GrSLType, 143 kVec4f_GrSLType,
139 GrShaderVar::kAttribute_TypeModifier))) { 144 GrShaderVar::kAttribute_TypeModifier))) {
140 fStroke = stroke; 145 fStroke = stroke;
141 } 146 }
142 147
143 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 148 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
144 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>(); 149 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>();
145 return cee.fStroke == fStroke; 150 return cee.fStroke == fStroke;
146 } 151 }
147 152
148 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
149 inout->fValidFlags = 0;
150 inout->fIsSingleComponent = false;
151 }
152
153 const GrShaderVar& fInCircleEdge; 153 const GrShaderVar& fInCircleEdge;
154 bool fStroke; 154 bool fStroke;
155 155
156 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 156 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
157 157
158 typedef GrGeometryProcessor INHERITED; 158 typedef GrGeometryProcessor INHERITED;
159 }; 159 };
160 160
161 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(CircleEdgeEffect); 161 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(CircleEdgeEffect);
162 162
(...skipping 22 matching lines...) Expand all
185 185
186 if (stroke) { 186 if (stroke) {
187 gEllipseStrokeEdge->ref(); 187 gEllipseStrokeEdge->ref();
188 return gEllipseStrokeEdge; 188 return gEllipseStrokeEdge;
189 } else { 189 } else {
190 gEllipseFillEdge->ref(); 190 gEllipseFillEdge->ref();
191 return gEllipseFillEdge; 191 return gEllipseFillEdge;
192 } 192 }
193 } 193 }
194 194
195 virtual void getConstantColorComponents(GrColor* color,
196 uint32_t* validFlags) const SK_OVERR IDE {
197 *validFlags = 0;
198 }
199
195 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE { 200 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE {
196 return GrTBackendGeometryProcessorFactory<EllipseEdgeEffect>::getInstanc e(); 201 return GrTBackendGeometryProcessorFactory<EllipseEdgeEffect>::getInstanc e();
197 } 202 }
198 203
199 virtual ~EllipseEdgeEffect() {} 204 virtual ~EllipseEdgeEffect() {}
200 205
201 static const char* Name() { return "EllipseEdge"; } 206 static const char* Name() { return "EllipseEdge"; }
202 207
203 const GrShaderVar& inEllipseOffset() const { return fInEllipseOffset; } 208 const GrShaderVar& inEllipseOffset() const { return fInEllipseOffset; }
204 const GrShaderVar& inEllipseRadii() const { return fInEllipseRadii; } 209 const GrShaderVar& inEllipseRadii() const { return fInEllipseRadii; }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 kVec4f_GrSLType, 284 kVec4f_GrSLType,
280 GrShaderVar::kAttribute_TypeModifier))) { 285 GrShaderVar::kAttribute_TypeModifier))) {
281 fStroke = stroke; 286 fStroke = stroke;
282 } 287 }
283 288
284 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 289 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
285 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>(); 290 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>();
286 return eee.fStroke == fStroke; 291 return eee.fStroke == fStroke;
287 } 292 }
288 293
289 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
290 inout->fValidFlags = 0;
291 inout->fIsSingleComponent = false;
292 }
293
294 const GrShaderVar& fInEllipseOffset; 294 const GrShaderVar& fInEllipseOffset;
295 const GrShaderVar& fInEllipseRadii; 295 const GrShaderVar& fInEllipseRadii;
296 bool fStroke; 296 bool fStroke;
297 297
298 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 298 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
299 299
300 typedef GrGeometryProcessor INHERITED; 300 typedef GrGeometryProcessor INHERITED;
301 }; 301 };
302 302
303 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(EllipseEdgeEffect); 303 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(EllipseEdgeEffect);
(...skipping 30 matching lines...) Expand all
334 return gEllipseStrokeEdge; 334 return gEllipseStrokeEdge;
335 } else if (kHairline == mode) { 335 } else if (kHairline == mode) {
336 gEllipseHairlineEdge->ref(); 336 gEllipseHairlineEdge->ref();
337 return gEllipseHairlineEdge; 337 return gEllipseHairlineEdge;
338 } else { 338 } else {
339 gEllipseFillEdge->ref(); 339 gEllipseFillEdge->ref();
340 return gEllipseFillEdge; 340 return gEllipseFillEdge;
341 } 341 }
342 } 342 }
343 343
344 virtual void getConstantColorComponents(GrColor* color,
345 uint32_t* validFlags) const SK_OVERR IDE {
346 *validFlags = 0;
347 }
348
344 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE { 349 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR IDE {
345 return GrTBackendGeometryProcessorFactory<DIEllipseEdgeEffect>::getInsta nce(); 350 return GrTBackendGeometryProcessorFactory<DIEllipseEdgeEffect>::getInsta nce();
346 } 351 }
347 352
348 virtual ~DIEllipseEdgeEffect() {} 353 virtual ~DIEllipseEdgeEffect() {}
349 354
350 static const char* Name() { return "DIEllipseEdge"; } 355 static const char* Name() { return "DIEllipseEdge"; }
351 356
352 const GrShaderVar& inEllipseOffsets0() const { return fInEllipseOffsets0; } 357 const GrShaderVar& inEllipseOffsets0() const { return fInEllipseOffsets0; }
353 const GrShaderVar& inEllipseOffsets1() const { return fInEllipseOffsets1; } 358 const GrShaderVar& inEllipseOffsets1() const { return fInEllipseOffsets1; }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 kVec2f_GrSLType, 453 kVec2f_GrSLType,
449 GrShaderVar::kAttribute_TypeModifier))) { 454 GrShaderVar::kAttribute_TypeModifier))) {
450 fMode = mode; 455 fMode = mode;
451 } 456 }
452 457
453 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 458 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
454 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>(); 459 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>();
455 return eee.fMode == fMode; 460 return eee.fMode == fMode;
456 } 461 }
457 462
458 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
459 inout->fValidFlags = 0;
460 inout->fIsSingleComponent = false;
461 }
462
463 const GrShaderVar& fInEllipseOffsets0; 463 const GrShaderVar& fInEllipseOffsets0;
464 const GrShaderVar& fInEllipseOffsets1; 464 const GrShaderVar& fInEllipseOffsets1;
465 Mode fMode; 465 Mode fMode;
466 466
467 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 467 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
468 468
469 typedef GrGeometryProcessor INHERITED; 469 typedef GrGeometryProcessor INHERITED;
470 }; 470 };
471 471
472 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DIEllipseEdgeEffect); 472 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DIEllipseEdgeEffect);
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 1237
1238 // drop out the middle quad if we're stroked 1238 // drop out the middle quad if we're stroked
1239 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : 1239 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 :
1240 SK_ARRAY_COUNT(gRRectIndices); 1240 SK_ARRAY_COUNT(gRRectIndices);
1241 target->setIndexSourceToBuffer(indexBuffer); 1241 target->setIndexSourceToBuffer(indexBuffer);
1242 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou nds); 1242 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou nds);
1243 } 1243 }
1244 1244
1245 return true; 1245 return true;
1246 } 1246 }
OLDNEW
« no previous file with comments | « src/gpu/GrOptDrawState.cpp ('k') | src/gpu/GrPaint.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698