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

Unified Diff: include/gpu/GrGeometryProcessor.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrGeometryProcessor.h
diff --git a/include/gpu/GrGeometryProcessor.h b/include/gpu/GrGeometryProcessor.h
index 61659cf17125d7a18248e2cfcadff62a2f015477..fe7905a31b5b98883d35d716ef6e6e709cde466e 100644
--- a/include/gpu/GrGeometryProcessor.h
+++ b/include/gpu/GrGeometryProcessor.h
@@ -37,6 +37,19 @@ public:
const VertexAttribArray& getVertexAttribs() const { return fVertexAttribs; }
+ bool isEqual(const GrGeometryProcessor& that) const {
+ if (&this->getFactory() != &that.getFactory()) {
+ return false;
+ }
+ bool result = this->onIsEqual(that);
+#ifdef SK_DEBUG
+ if (result) {
+ this->assertTexturesEqual(that);
+ }
+#endif
+ return result;
+ }
+
protected:
/**
* Subclasses call this from their constructor to register vertex attributes (at most
@@ -49,6 +62,8 @@ protected:
}
private:
+ virtual bool onIsEqual(const GrGeometryProcessor&) const = 0;
+
SkSTArray<kMaxVertexAttribs, GrShaderVar, true> fVertexAttribs;
typedef GrProcessor INHERITED;
« no previous file with comments | « no previous file | include/gpu/GrProcessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698