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

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

Issue 862823004: Revert of GrBatchPrototype (Closed) Base URL: https://skia.googlesource.com/skia.git@lc2
Patch Set: Created 5 years, 11 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/GrBitmapTextGeoProc.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/GrGLProcessor.h" 10 #include "gl/GrGLProcessor.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); 201 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType));
202 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs", 202 fInConicCoeffs = &this->addVertexAttrib(Attribute("inConicCoeffs",
203 kVec4f_GrVertexAttribTyp e)); 203 kVec4f_GrVertexAttribTyp e));
204 } 204 }
205 205
206 bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const { 206 bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const {
207 const GrConicEffect& ce = other.cast<GrConicEffect>(); 207 const GrConicEffect& ce = other.cast<GrConicEffect>();
208 return (ce.fEdgeType == fEdgeType); 208 return (ce.fEdgeType == fEdgeType);
209 } 209 }
210 210
211 void GrConicEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& i nit) const { 211 void GrConicEffect::initBatchTracker(GrBatchTracker* bt, const InitBT& init) con st {
212 ConicBatchTracker* local = bt->cast<ConicBatchTracker>(); 212 ConicBatchTracker* local = bt->cast<ConicBatchTracker>();
213 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false); 213 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false);
214 local->fCoverageScale = fCoverageScale; 214 local->fCoverageScale = fCoverageScale;
215 local->fUsesLocalCoords = init.fUsesLocalCoords; 215 local->fUsesLocalCoords = init.fUsesLocalCoords;
216 } 216 }
217 217
218 bool GrConicEffect::onCanMakeEqual(const GrBatchTracker& m, 218 bool GrConicEffect::onCanMakeEqual(const GrBatchTracker& m,
219 const GrGeometryProcessor& that, 219 const GrGeometryProcessor& that,
220 const GrBatchTracker& t) const { 220 const GrBatchTracker& t) const {
221 const ConicBatchTracker& mine = m.cast<ConicBatchTracker>(); 221 const ConicBatchTracker& mine = m.cast<ConicBatchTracker>();
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); 425 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType));
426 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge", 426 fInHairQuadEdge = &this->addVertexAttrib(Attribute("inHairQuadEdge",
427 kVec4f_GrVertexAttribTyp e)); 427 kVec4f_GrVertexAttribTyp e));
428 } 428 }
429 429
430 bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const { 430 bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const {
431 const GrQuadEffect& ce = other.cast<GrQuadEffect>(); 431 const GrQuadEffect& ce = other.cast<GrQuadEffect>();
432 return (ce.fEdgeType == fEdgeType); 432 return (ce.fEdgeType == fEdgeType);
433 } 433 }
434 434
435 void GrQuadEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& in it) const { 435 void GrQuadEffect::initBatchTracker(GrBatchTracker* bt, const InitBT& init) cons t {
436 QuadBatchTracker* local = bt->cast<QuadBatchTracker>(); 436 QuadBatchTracker* local = bt->cast<QuadBatchTracker>();
437 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false); 437 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false);
438 local->fCoverageScale = fCoverageScale; 438 local->fCoverageScale = fCoverageScale;
439 local->fUsesLocalCoords = init.fUsesLocalCoords; 439 local->fUsesLocalCoords = init.fUsesLocalCoords;
440 } 440 }
441 441
442 bool GrQuadEffect::onCanMakeEqual(const GrBatchTracker& m, 442 bool GrQuadEffect::onCanMakeEqual(const GrBatchTracker& m,
443 const GrGeometryProcessor& that, 443 const GrGeometryProcessor& that,
444 const GrBatchTracker& t) const { 444 const GrBatchTracker& t) const {
445 const QuadBatchTracker& mine = m.cast<QuadBatchTracker>(); 445 const QuadBatchTracker& mine = m.cast<QuadBatchTracker>();
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType)); 670 fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertex AttribType));
671 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs", 671 fInCubicCoeffs = &this->addVertexAttrib(Attribute("inCubicCoeffs",
672 kVec4f_GrVertexAttribTyp e)); 672 kVec4f_GrVertexAttribTyp e));
673 } 673 }
674 674
675 bool GrCubicEffect::onIsEqual(const GrGeometryProcessor& other) const { 675 bool GrCubicEffect::onIsEqual(const GrGeometryProcessor& other) const {
676 const GrCubicEffect& ce = other.cast<GrCubicEffect>(); 676 const GrCubicEffect& ce = other.cast<GrCubicEffect>();
677 return (ce.fEdgeType == fEdgeType); 677 return (ce.fEdgeType == fEdgeType);
678 } 678 }
679 679
680 void GrCubicEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& i nit) const { 680 void GrCubicEffect::initBatchTracker(GrBatchTracker* bt, const InitBT& init) con st {
681 CubicBatchTracker* local = bt->cast<CubicBatchTracker>(); 681 CubicBatchTracker* local = bt->cast<CubicBatchTracker>();
682 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false); 682 local->fInputColorType = GetColorInputType(&local->fColor, this->color(), in it, false);
683 local->fUsesLocalCoords = init.fUsesLocalCoords; 683 local->fUsesLocalCoords = init.fUsesLocalCoords;
684 } 684 }
685 685
686 bool GrCubicEffect::onCanMakeEqual(const GrBatchTracker& m, 686 bool GrCubicEffect::onCanMakeEqual(const GrBatchTracker& m,
687 const GrGeometryProcessor& that, 687 const GrGeometryProcessor& that,
688 const GrBatchTracker& t) const { 688 const GrBatchTracker& t) const {
689 const CubicBatchTracker& mine = m.cast<CubicBatchTracker>(); 689 const CubicBatchTracker& mine = m.cast<CubicBatchTracker>();
690 const CubicBatchTracker& theirs = t.cast<CubicBatchTracker>(); 690 const CubicBatchTracker& theirs = t.cast<CubicBatchTracker>();
(...skipping 14 matching lines...) Expand all
705 GrGeometryProcessor* gp; 705 GrGeometryProcessor* gp;
706 do { 706 do {
707 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 707 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
708 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); 708 random->nextULessThan(kGrPro cessorEdgeTypeCnt));
709 gp = GrCubicEffect::Create(GrRandomColor(random), 709 gp = GrCubicEffect::Create(GrRandomColor(random),
710 GrProcessorUnitTest::TestMatrix(random), edge Type, caps); 710 GrProcessorUnitTest::TestMatrix(random), edge Type, caps);
711 } while (NULL == gp); 711 } while (NULL == gp);
712 return gp; 712 return gp;
713 } 713 }
714 714
OLDNEW
« no previous file with comments | « src/gpu/effects/GrBezierEffect.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698