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

Unified Diff: include/gpu/GrEffectStage.h

Issue 438053002: Don't compare coord change matrices to determine effect compatibility when using explicit local coo… (Closed) Base URL: https://skia.googlesource.com/skia.git@nomat
Patch Set: Add comment Created 6 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 | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrEffectStage.h
diff --git a/include/gpu/GrEffectStage.h b/include/gpu/GrEffectStage.h
index fb0620d6e6df097ca1f15ef7f1961b1c22373aef..65c7bebdc7056f7da58960ea61e489fd5c2cd73d 100644
--- a/include/gpu/GrEffectStage.h
+++ b/include/gpu/GrEffectStage.h
@@ -40,28 +40,33 @@ public:
memcpy(fVertexAttribIndices, other.fVertexAttribIndices, sizeof(fVertexAttribIndices));
return *this;
}
+
+ static bool AreCompatible(const GrEffectStage& a, const GrEffectStage& b,
+ bool usingExplicitLocalCoords) {
+ SkASSERT(NULL != a.fEffect.get());
+ SkASSERT(NULL != b.fEffect.get());
- bool operator== (const GrEffectStage& other) const {
- SkASSERT(NULL != fEffect.get());
- SkASSERT(NULL != other.fEffect.get());
-
- if (!this->getEffect()->isEqual(*other.getEffect())) {
+ if (!a.getEffect()->isEqual(*b.getEffect())) {
return false;
}
- if (fCoordChangeMatrixSet != other.fCoordChangeMatrixSet) {
+ // We always track the coord change matrix, but it has no effect when explicit local coords
+ // are used.
+ if (usingExplicitLocalCoords) {
+ return true;
+ }
+
+ if (a.fCoordChangeMatrixSet != b.fCoordChangeMatrixSet) {
return false;
}
- if (!fCoordChangeMatrixSet) {
+ if (!a.fCoordChangeMatrixSet) {
return true;
}
- return fCoordChangeMatrix == other.fCoordChangeMatrix;
+ return a.fCoordChangeMatrix == b.fCoordChangeMatrix;
}
- bool operator!= (const GrEffectStage& s) const { return !(*this == s); }
-
/**
* This is called when the coordinate system in which the geometry is specified will change.
*
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698