Index: src/gpu/GrProcessor.cpp |
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp |
index 39c55a60e4d12ed26f11eacd861dc502f3ecf56b..3090d0f461016391e6e5429fe06792f25c977a57 100644 |
--- a/src/gpu/GrProcessor.cpp |
+++ b/src/gpu/GrProcessor.cpp |
@@ -129,6 +129,33 @@ bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const { |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
+bool GrFragmentProcessor::isEqual(const GrFragmentProcessor& that, |
+ bool ignoreCoordTransforms) const { |
+ if (this->classID() != that.classID() || |
+ !this->hasSameTextureAccesses(that)) { |
+ return false; |
+ } |
+ if (ignoreCoordTransforms) { |
+ if (this->numTransforms() != that.numTransforms()) { |
+ return false; |
+ } |
+ } else if (!this->hasSameTransforms(that)) { |
+ return false; |
+ } |
+ if (!this->onIsEqual(that)) { |
+ return false; |
+ } |
+ if (this->numChildProcessors() != that.numChildProcessors()) { |
+ return false; |
+ } |
+ for (int i = 0; i < this->numChildProcessors(); ++i) { |
+ if (!this->childProcessor(i).isEqual(that.childProcessor(i), ignoreCoordTransforms)) { |
+ return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
void GrFragmentProcessor::addCoordTransform(const GrCoordTransform* transform) { |
fCoordTransforms.push_back(transform); |
fUsesLocalCoords = fUsesLocalCoords || transform->sourceCoords() == kLocal_GrCoordSet; |