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

Unified Diff: src/gpu/GrProcessor.cpp

Issue 654313002: Auto-compare GrProcessors' texture accesses in isEqual(). (Closed) Base URL: https://skia.googlesource.com/skia.git@xformcomp
Patch Set: update 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 | « src/effects/gradients/SkGradientShader.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | 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 da27abb4a95d4c16271af734bc2555edcb8f7cbf..fb4e0d6ccfc75a01b9dfc276cb70544f2e4f7d06 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -116,14 +116,20 @@ void GrProcessor::operator delete(void* target) {
GrProcessor_Globals::GetTLS()->release(target);
}
-#ifdef SK_DEBUG
-void GrProcessor::assertTexturesEqual(const GrProcessor& other) const {
- SkASSERT(this->numTextures() == other.numTextures());
+bool GrProcessor::hasSameTextureAccesses(const GrProcessor& that) const {
+ if (this->numTextures() != that.numTextures()) {
+ return false;
+ }
for (int i = 0; i < this->numTextures(); ++i) {
- SkASSERT(this->textureAccess(i) == other.textureAccess(i));
+ if (this->textureAccess(i) != that.textureAccess(i)) {
+ return false;
+ }
}
+ return true;
}
+#ifdef SK_DEBUG
+
void GrProcessor::InvariantOutput::validate() const {
if (fIsSingleComponent) {
SkASSERT(0 == fValidFlags || kRGBA_GrColorComponentFlags == fValidFlags);
« no previous file with comments | « src/effects/gradients/SkGradientShader.cpp ('k') | src/gpu/effects/GrBicubicEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698