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

Side by Side Diff: src/gpu/effects/GrBezierEffect.cpp

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (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/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrBicubicEffect.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 "GrBezierEffect.h" 8 #include "GrBezierEffect.h"
9 9
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return GrTBackendGeometryProcessorFactory<GrConicEffect>::getInstance(); 134 return GrTBackendGeometryProcessorFactory<GrConicEffect>::getInstance();
135 } 135 }
136 136
137 GrConicEffect::GrConicEffect(GrPrimitiveEdgeType edgeType) 137 GrConicEffect::GrConicEffect(GrPrimitiveEdgeType edgeType)
138 : fEdgeType(edgeType) 138 : fEdgeType(edgeType)
139 , fInConicCoeffs(this->addVertexAttrib(GrShaderVar("inConicCoeffs", 139 , fInConicCoeffs(this->addVertexAttrib(GrShaderVar("inConicCoeffs",
140 kVec4f_GrSLType, 140 kVec4f_GrSLType,
141 GrShaderVar::kAttribute_T ypeModifier))) { 141 GrShaderVar::kAttribute_T ypeModifier))) {
142 } 142 }
143 143
144 bool GrConicEffect::onIsEqual(const GrProcessor& other) const { 144 bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const {
145 const GrConicEffect& ce = other.cast<GrConicEffect>(); 145 const GrConicEffect& ce = other.cast<GrConicEffect>();
146 return (ce.fEdgeType == fEdgeType); 146 return (ce.fEdgeType == fEdgeType);
147 } 147 }
148 148
149 ////////////////////////////////////////////////////////////////////////////// 149 //////////////////////////////////////////////////////////////////////////////
150 150
151 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect); 151 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect);
152 152
153 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random, 153 GrGeometryProcessor* GrConicEffect::TestCreate(SkRandom* random,
154 GrContext*, 154 GrContext*,
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 return GrTBackendGeometryProcessorFactory<GrQuadEffect>::getInstance(); 272 return GrTBackendGeometryProcessorFactory<GrQuadEffect>::getInstance();
273 } 273 }
274 274
275 GrQuadEffect::GrQuadEffect(GrPrimitiveEdgeType edgeType) 275 GrQuadEffect::GrQuadEffect(GrPrimitiveEdgeType edgeType)
276 : fEdgeType(edgeType) 276 : fEdgeType(edgeType)
277 , fInHairQuadEdge(this->addVertexAttrib(GrShaderVar("inCubicCoeffs", 277 , fInHairQuadEdge(this->addVertexAttrib(GrShaderVar("inCubicCoeffs",
278 kVec4f_GrSLType, 278 kVec4f_GrSLType,
279 GrShaderVar::kAttribute_ TypeModifier))) { 279 GrShaderVar::kAttribute_ TypeModifier))) {
280 } 280 }
281 281
282 bool GrQuadEffect::onIsEqual(const GrProcessor& other) const { 282 bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const {
283 const GrQuadEffect& ce = other.cast<GrQuadEffect>(); 283 const GrQuadEffect& ce = other.cast<GrQuadEffect>();
284 return (ce.fEdgeType == fEdgeType); 284 return (ce.fEdgeType == fEdgeType);
285 } 285 }
286 286
287 ////////////////////////////////////////////////////////////////////////////// 287 //////////////////////////////////////////////////////////////////////////////
288 288
289 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect); 289 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect);
290 290
291 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random, 291 GrGeometryProcessor* GrQuadEffect::TestCreate(SkRandom* random,
292 GrContext*, 292 GrContext*,
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 return GrTBackendGeometryProcessorFactory<GrCubicEffect>::getInstance(); 452 return GrTBackendGeometryProcessorFactory<GrCubicEffect>::getInstance();
453 } 453 }
454 454
455 GrCubicEffect::GrCubicEffect(GrPrimitiveEdgeType edgeType) 455 GrCubicEffect::GrCubicEffect(GrPrimitiveEdgeType edgeType)
456 : fEdgeType(edgeType) 456 : fEdgeType(edgeType)
457 , fInCubicCoeffs(this->addVertexAttrib(GrShaderVar("inCubicCoeffs", 457 , fInCubicCoeffs(this->addVertexAttrib(GrShaderVar("inCubicCoeffs",
458 kVec4f_GrSLType, 458 kVec4f_GrSLType,
459 GrShaderVar::kAttribute_T ypeModifier))) { 459 GrShaderVar::kAttribute_T ypeModifier))) {
460 } 460 }
461 461
462 bool GrCubicEffect::onIsEqual(const GrProcessor& other) const { 462 bool GrCubicEffect::onIsEqual(const GrGeometryProcessor& other) const {
463 const GrCubicEffect& ce = other.cast<GrCubicEffect>(); 463 const GrCubicEffect& ce = other.cast<GrCubicEffect>();
464 return (ce.fEdgeType == fEdgeType); 464 return (ce.fEdgeType == fEdgeType);
465 } 465 }
466 466
467 ////////////////////////////////////////////////////////////////////////////// 467 //////////////////////////////////////////////////////////////////////////////
468 468
469 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect); 469 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect);
470 470
471 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random, 471 GrGeometryProcessor* GrCubicEffect::TestCreate(SkRandom* random,
472 GrContext*, 472 GrContext*,
473 const GrDrawTargetCaps& caps, 473 const GrDrawTargetCaps& caps,
474 GrTexture*[]) { 474 GrTexture*[]) {
475 GrGeometryProcessor* gp; 475 GrGeometryProcessor* gp;
476 do { 476 do {
477 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 477 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
478 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); 478 random->nextULessThan(kGrPro cessorEdgeTypeCnt));
479 gp = GrCubicEffect::Create(edgeType, caps); 479 gp = GrCubicEffect::Create(edgeType, caps);
480 } while (NULL == gp); 480 } while (NULL == gp);
481 return gp; 481 return gp;
482 } 482 }
483 483
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrBicubicEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698