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

Unified Diff: src/gpu/GrOvalRenderer.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/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTestBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index 727ff169e8e68c952b0f87104bad72bff55f2617..d22b4628bb54c314e2368d9d46d975838d0df0ec 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -173,6 +173,17 @@
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
+ bool onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const override {
+ const BatchTracker& mine = m.cast<BatchTracker>();
+ const BatchTracker& theirs = t.cast<BatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor);
+ }
+
private:
CircleEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix)
: INHERITED(color, SkMatrix::I(), localMatrix) {
@@ -181,6 +192,15 @@
fInCircleEdge = &this->addVertexAttrib(Attribute("inCircleEdge",
kVec4f_GrVertexAttribType));
fStroke = stroke;
+ }
+
+ bool onIsEqual(const GrGeometryProcessor& other) const override {
+ const CircleEdgeEffect& cee = other.cast<CircleEdgeEffect>();
+ return cee.fStroke == fStroke;
+ }
+
+ void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
+ out->setUnknownSingleComponent();
}
struct BatchTracker {
@@ -348,6 +368,17 @@
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
+ bool onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const override {
+ const BatchTracker& mine = m.cast<BatchTracker>();
+ const BatchTracker& theirs = t.cast<BatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor);
+ }
+
private:
EllipseEdgeEffect(GrColor color, bool stroke, const SkMatrix& localMatrix)
: INHERITED(color, SkMatrix::I(), localMatrix) {
@@ -358,6 +389,15 @@
fInEllipseRadii = &this->addVertexAttrib(Attribute("inEllipseRadii",
kVec4f_GrVertexAttribType));
fStroke = stroke;
+ }
+
+ bool onIsEqual(const GrGeometryProcessor& other) const override {
+ const EllipseEdgeEffect& eee = other.cast<EllipseEdgeEffect>();
+ return eee.fStroke == fStroke;
+ }
+
+ void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
+ out->setUnknownSingleComponent();
}
struct BatchTracker {
@@ -543,6 +583,17 @@
local->fUsesLocalCoords = init.fUsesLocalCoords;
}
+ bool onCanMakeEqual(const GrBatchTracker& m,
+ const GrGeometryProcessor& that,
+ const GrBatchTracker& t) const override {
+ const BatchTracker& mine = m.cast<BatchTracker>();
+ const BatchTracker& theirs = t.cast<BatchTracker>();
+ return CanCombineLocalMatrices(*this, mine.fUsesLocalCoords,
+ that, theirs.fUsesLocalCoords) &&
+ CanCombineOutput(mine.fInputColorType, mine.fColor,
+ theirs.fInputColorType, theirs.fColor);
+ }
+
private:
DIEllipseEdgeEffect(GrColor color, const SkMatrix& viewMatrix, Mode mode)
: INHERITED(color, viewMatrix) {
@@ -553,6 +604,15 @@
fInEllipseOffsets1 = &this->addVertexAttrib(Attribute("inEllipseOffsets1",
kVec2f_GrVertexAttribType));
fMode = mode;
+ }
+
+ bool onIsEqual(const GrGeometryProcessor& other) const override {
+ const DIEllipseEdgeEffect& eee = other.cast<DIEllipseEdgeEffect>();
+ return eee.fMode == fMode;
+ }
+
+ void onGetInvariantOutputCoverage(GrInitInvariantOutput* out) const override {
+ out->setUnknownSingleComponent();
}
struct BatchTracker {
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.cpp ('k') | src/gpu/GrTestBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698