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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 1287343005: Made isEqual in GrFragmentProcessor recursive (Closed) Base URL: https://skia.googlesource.com/skia@cs3_autoAdvance
Patch Set: removed comment on computeInvariantOutput Created 5 years, 4 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 | « include/gpu/GrFragmentProcessor.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « include/gpu/GrFragmentProcessor.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698