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; }
bool GrFragmentProcessor::hasSameTransforms(const GrFragmentProcessor& that) const { if (this->numTransforms() != that.numTransforms()) { return false; } int count = this->numTransforms(); for (int i = 0; i < count; ++i) { if (this->coordTransform(i) != that.coordTransform(i)) { return false; } } return true; }