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

Unified Diff: src/gpu/effects/GrDistanceFieldGeoProc.cpp

Issue 1111603004: removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: tweaks Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 64811a5a0348fd7ce6101625b2c9c43a9283d2e8..bd48e51b2f688f022317e46c33086a02357ea3ae 100755
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -196,8 +196,8 @@ GrDistanceFieldA8TextGeoProc::GrDistanceFieldA8TextGeoProc(GrColor color,
#ifdef SK_GAMMA_APPLY_TO_A8
float distanceAdjust,
#endif
- uint32_t flags, bool opaqueVertexColors)
- : INHERITED(color, viewMatrix, SkMatrix::I(), opaqueVertexColors)
+ uint32_t flags)
+ : INHERITED(color, viewMatrix, SkMatrix::I())
, fTextureAccess(texture, params)
#ifdef SK_GAMMA_APPLY_TO_A8
, fDistanceAdjust(distanceAdjust)
@@ -209,26 +209,12 @@ GrDistanceFieldA8TextGeoProc::GrDistanceFieldA8TextGeoProc(GrColor color,
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
if (flags & kColorAttr_DistanceFieldEffectFlag) {
fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
- this->setHasVertexColor();
}
fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
kVec2s_GrVertexAttribType));
this->addTextureAccess(&fTextureAccess);
}
-bool GrDistanceFieldA8TextGeoProc::onIsEqual(const GrGeometryProcessor& other) const {
- const GrDistanceFieldA8TextGeoProc& cte = other.cast<GrDistanceFieldA8TextGeoProc>();
- return
-#ifdef SK_GAMMA_APPLY_TO_A8
- fDistanceAdjust == cte.fDistanceAdjust &&
-#endif
- fFlags == cte.fFlags;
-}
-
-void GrDistanceFieldA8TextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
-}
-
void GrDistanceFieldA8TextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
@@ -249,17 +235,6 @@ void GrDistanceFieldA8TextGeoProc::initBatchTracker(GrBatchTracker* bt,
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
-bool GrDistanceFieldA8TextGeoProc::onCanMakeEqual(const GrBatchTracker& m,
- const GrGeometryProcessor& that,
- const GrBatchTracker& t) const {
- const DistanceFieldBatchTracker& mine = m.cast<DistanceFieldBatchTracker>();
- const DistanceFieldBatchTracker& theirs = t.cast<DistanceFieldBatchTracker>();
- return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
- that, theirs.fUsesLocalCoords) &&
- CanCombineOutput(mine.fInputColorType, mine.fColor,
- theirs.fInputColorType, theirs.fColor);
-}
-
///////////////////////////////////////////////////////////////////////////////
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldA8TextGeoProc);
@@ -289,8 +264,7 @@ GrGeometryProcessor* GrDistanceFieldA8TextGeoProc::TestCreate(SkRandom* random,
random->nextF(),
#endif
random->nextBool() ?
- kSimilarity_DistanceFieldEffectFlag : 0,
- random->nextBool());
+ kSimilarity_DistanceFieldEffectFlag : 0);
}
///////////////////////////////////////////////////////////////////////////////
@@ -448,9 +422,8 @@ GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc(
const SkMatrix& viewMatrix,
GrTexture* texture,
const GrTextureParams& params,
- uint32_t flags,
- bool opaqueVertexColors)
- : INHERITED(color, viewMatrix, SkMatrix::I(), opaqueVertexColors)
+ uint32_t flags)
+ : INHERITED(color, viewMatrix, SkMatrix::I())
, fTextureAccess(texture, params)
, fFlags(flags & kNonLCD_DistanceFieldEffectMask)
, fInColor(NULL) {
@@ -459,22 +432,12 @@ GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc(
fInPosition = &this->addVertexAttrib(Attribute("inPosition", kVec2f_GrVertexAttribType));
if (flags & kColorAttr_DistanceFieldEffectFlag) {
fInColor = &this->addVertexAttrib(Attribute("inColor", kVec4ub_GrVertexAttribType));
- this->setHasVertexColor();
}
fInTextureCoords = &this->addVertexAttrib(Attribute("inTextureCoords",
kVec2f_GrVertexAttribType));
this->addTextureAccess(&fTextureAccess);
}
-bool GrDistanceFieldPathGeoProc::onIsEqual(const GrGeometryProcessor& other) const {
- const GrDistanceFieldPathGeoProc& cte = other.cast<GrDistanceFieldPathGeoProc>();
- return fFlags == cte.fFlags;
-}
-
-void GrDistanceFieldPathGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownSingleComponent();
-}
-
void GrDistanceFieldPathGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
@@ -494,17 +457,6 @@ void GrDistanceFieldPathGeoProc::initBatchTracker(GrBatchTracker* bt,
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
-bool GrDistanceFieldPathGeoProc::onCanMakeEqual(const GrBatchTracker& m,
- const GrGeometryProcessor& that,
- const GrBatchTracker& t) const {
- const DistanceFieldPathBatchTracker& mine = m.cast<DistanceFieldPathBatchTracker>();
- const DistanceFieldPathBatchTracker& theirs = t.cast<DistanceFieldPathBatchTracker>();
- return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
- that, theirs.fUsesLocalCoords) &&
- CanCombineOutput(mine.fInputColorType, mine.fColor,
- theirs.fInputColorType, theirs.fColor);
-}
-
///////////////////////////////////////////////////////////////////////////////
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldPathGeoProc);
@@ -531,7 +483,7 @@ GrGeometryProcessor* GrDistanceFieldPathGeoProc::TestCreate(SkRandom* random,
GrTest::TestMatrix(random),
textures[texIdx],
params,
- random->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0, random->nextBool());
+ random->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0);
}
///////////////////////////////////////////////////////////////////////////////
@@ -751,17 +703,6 @@ GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc(
this->addTextureAccess(&fTextureAccess);
}
-bool GrDistanceFieldLCDTextGeoProc::onIsEqual(const GrGeometryProcessor& other) const {
- const GrDistanceFieldLCDTextGeoProc& cte = other.cast<GrDistanceFieldLCDTextGeoProc>();
- return (fDistanceAdjust == cte.fDistanceAdjust &&
- fFlags == cte.fFlags);
-}
-
-void GrDistanceFieldLCDTextGeoProc::onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const {
- out->setUnknownFourComponents();
- out->setUsingLCDCoverage();
-}
-
void GrDistanceFieldLCDTextGeoProc::getGLProcessorKey(const GrBatchTracker& bt,
const GrGLSLCaps& caps,
GrProcessorKeyBuilder* b) const {
@@ -781,17 +722,6 @@ void GrDistanceFieldLCDTextGeoProc::initBatchTracker(GrBatchTracker* bt,
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
-bool GrDistanceFieldLCDTextGeoProc::onCanMakeEqual(const GrBatchTracker& m,
- const GrGeometryProcessor& that,
- const GrBatchTracker& t) const {
- const DistanceFieldLCDBatchTracker& mine = m.cast<DistanceFieldLCDBatchTracker>();
- const DistanceFieldLCDBatchTracker& theirs = t.cast<DistanceFieldLCDBatchTracker>();
- return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
- that, theirs.fUsesLocalCoords) &&
- CanCombineOutput(mine.fInputColorType, mine.fColor,
- theirs.fInputColorType, theirs.fColor);
-}
-
///////////////////////////////////////////////////////////////////////////////
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldLCDTextGeoProc);
« no previous file with comments | « src/gpu/effects/GrDistanceFieldGeoProc.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698