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; |