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

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

Issue 643743003: Create helper functions to use in computeInvariantOutput calls (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update blurMaskFilter 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/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('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/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 GrShaderVar::kAttribute_TypeModifier))) { 139 GrShaderVar::kAttribute_TypeModifier))) {
140 fStroke = stroke; 140 fStroke = stroke;
141 } 141 }
142 142
143 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 143 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
144 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>(); 144 const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>();
145 return cee.fStroke == fStroke; 145 return cee.fStroke == fStroke;
146 } 146 }
147 147
148 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 148 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
149 inout->fValidFlags = 0; 149 inout->mulByUnknownAlpha();
150 inout->fIsSingleComponent = false;
151 } 150 }
152 151
153 const GrShaderVar& fInCircleEdge; 152 const GrShaderVar& fInCircleEdge;
154 bool fStroke; 153 bool fStroke;
155 154
156 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 155 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
157 156
158 typedef GrGeometryProcessor INHERITED; 157 typedef GrGeometryProcessor INHERITED;
159 }; 158 };
160 159
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 GrShaderVar::kAttribute_TypeModifier))) { 279 GrShaderVar::kAttribute_TypeModifier))) {
281 fStroke = stroke; 280 fStroke = stroke;
282 } 281 }
283 282
284 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 283 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
285 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>(); 284 const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>();
286 return eee.fStroke == fStroke; 285 return eee.fStroke == fStroke;
287 } 286 }
288 287
289 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 288 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
290 inout->fValidFlags = 0; 289 inout->mulByUnknownAlpha();
291 inout->fIsSingleComponent = false;
292 } 290 }
293 291
294 const GrShaderVar& fInEllipseOffset; 292 const GrShaderVar& fInEllipseOffset;
295 const GrShaderVar& fInEllipseRadii; 293 const GrShaderVar& fInEllipseRadii;
296 bool fStroke; 294 bool fStroke;
297 295
298 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 296 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
299 297
300 typedef GrGeometryProcessor INHERITED; 298 typedef GrGeometryProcessor INHERITED;
301 }; 299 };
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 GrShaderVar::kAttribute_TypeModifier))) { 447 GrShaderVar::kAttribute_TypeModifier))) {
450 fMode = mode; 448 fMode = mode;
451 } 449 }
452 450
453 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE { 451 virtual bool onIsEqual(const GrProcessor& other) const SK_OVERRIDE {
454 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>(); 452 const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>();
455 return eee.fMode == fMode; 453 return eee.fMode == fMode;
456 } 454 }
457 455
458 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE { 456 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR IDE {
459 inout->fValidFlags = 0; 457 inout->mulByUnknownAlpha();
460 inout->fIsSingleComponent = false;
461 } 458 }
462 459
463 const GrShaderVar& fInEllipseOffsets0; 460 const GrShaderVar& fInEllipseOffsets0;
464 const GrShaderVar& fInEllipseOffsets1; 461 const GrShaderVar& fInEllipseOffsets1;
465 Mode fMode; 462 Mode fMode;
466 463
467 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 464 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
468 465
469 typedef GrGeometryProcessor INHERITED; 466 typedef GrGeometryProcessor INHERITED;
470 }; 467 };
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
1237 1234
1238 // drop out the middle quad if we're stroked 1235 // drop out the middle quad if we're stroked
1239 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 : 1236 int indexCnt = isStrokeOnly ? SK_ARRAY_COUNT(gRRectIndices) - 6 :
1240 SK_ARRAY_COUNT(gRRectIndices); 1237 SK_ARRAY_COUNT(gRRectIndices);
1241 target->setIndexSourceToBuffer(indexBuffer); 1238 target->setIndexSourceToBuffer(indexBuffer);
1242 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou nds); 1239 target->drawIndexed(kTriangles_GrPrimitiveType, 0, 0, 16, indexCnt, &bou nds);
1243 } 1240 }
1244 1241
1245 return true; 1242 return true;
1246 } 1243 }
OLDNEW
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/effects/GrBezierEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698