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

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

Issue 1110993002: Revert of removing equality / compute invariant loops from GrGeometryProcessors (Closed) Base URL: https://skia.googlesource.com/skia.git@cleanup1
Patch Set: Created 5 years, 8 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/GrBezierEffect.h ('k') | src/gpu/effects/GrBitmapTextGeoProc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/effects/GrBezierEffect.cpp
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index c56c47b77e9bbd97b5c7343d483157f1674c8044..90b91b0bd2c34cd7fe44a2ef0f5778dcbd1051c5 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -200,11 +200,28 @@
kVec4f_GrVertexAttribType));
}
+bool GrConicEffect::onIsEqual(const GrGeometryProcessor& other) const {
+ const GrConicEffect& ce = other.cast<GrConicEffect>();
+ return (ce.fEdgeType == fEdgeType);
+}
+
void GrConicEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const {
ConicBatchTracker* local = bt->cast<ConicBatchTracker>();
local->fInputColorType = GetColorInputType(&local->fColor, this->color(), init, false);
local->fCoverageScale = fCoverageScale;
local->fUsesLocalCoords = init.fUsesLocalCoords;
+}
+
+bool GrConicEffect::onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const {
+ const ConicBatchTracker& mine = m.cast<ConicBatchTracker>();
+ const ConicBatchTracker& theirs = t.cast<ConicBatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor) &&
+ mine.fCoverageScale == theirs.fCoverageScale;
}
//////////////////////////////////////////////////////////////////////////////
@@ -404,11 +421,28 @@
kVec4f_GrVertexAttribType));
}
+bool GrQuadEffect::onIsEqual(const GrGeometryProcessor& other) const {
+ const GrQuadEffect& ce = other.cast<GrQuadEffect>();
+ return (ce.fEdgeType == fEdgeType);
+}
+
void GrQuadEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const {
QuadBatchTracker* local = bt->cast<QuadBatchTracker>();
local->fInputColorType = GetColorInputType(&local->fColor, this->color(), init, false);
local->fCoverageScale = fCoverageScale;
local->fUsesLocalCoords = init.fUsesLocalCoords;
+}
+
+bool GrQuadEffect::onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const {
+ const QuadBatchTracker& mine = m.cast<QuadBatchTracker>();
+ const QuadBatchTracker& theirs = t.cast<QuadBatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor) &&
+ mine.fCoverageScale == theirs.fCoverageScale;
}
//////////////////////////////////////////////////////////////////////////////
@@ -629,10 +663,26 @@
kVec4f_GrVertexAttribType));
}
+bool GrCubicEffect::onIsEqual(const GrGeometryProcessor& other) const {
+ const GrCubicEffect& ce = other.cast<GrCubicEffect>();
+ return (ce.fEdgeType == fEdgeType);
+}
+
void GrCubicEffect::initBatchTracker(GrBatchTracker* bt, const GrPipelineInfo& init) const {
CubicBatchTracker* local = bt->cast<CubicBatchTracker>();
local->fInputColorType = GetColorInputType(&local->fColor, this->color(), init, false);
local->fUsesLocalCoords = init.fUsesLocalCoords;
+}
+
+bool GrCubicEffect::onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const {
+ const CubicBatchTracker& mine = m.cast<CubicBatchTracker>();
+ const CubicBatchTracker& theirs = t.cast<CubicBatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor);
}
//////////////////////////////////////////////////////////////////////////////
« 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