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. |
* |