Index: src/gpu/glsl/GrGLSLGeometryProcessor.h |
diff --git a/src/gpu/glsl/GrGLSLGeometryProcessor.h b/src/gpu/glsl/GrGLSLGeometryProcessor.h |
index 72f00f15090ae372085e0005167ff4ea4b00f240..00652a5b99bd2b07834ea55f5e0f4f0bd7a2ff67 100644 |
--- a/src/gpu/glsl/GrGLSLGeometryProcessor.h |
+++ b/src/gpu/glsl/GrGLSLGeometryProcessor.h |
@@ -27,18 +27,25 @@ public: |
const GrGLSLProgramDataManager& pdman, |
int index, |
const SkTArray<const GrCoordTransform*, true>& transforms) override { |
- this->setTransformDataMatrix(SkMatrix::I(), pdman, index, transforms); |
+ this->setTransformDataHelper(SkMatrix::I(), pdman, index, transforms); |
} |
protected: |
- // A helper which subclasses can use if needed |
- template <class GeometryProcessor> |
- void setTransformDataHelper(const GrPrimitiveProcessor& primProc, |
+ // A helper which subclasses can use if needed and used above in the default setTransformData(). |
+ void setTransformDataHelper(const SkMatrix& localMatrix, |
const GrGLSLProgramDataManager& pdman, |
int index, |
const SkTArray<const GrCoordTransform*, true>& transforms) { |
- const GeometryProcessor& gp = primProc.cast<GeometryProcessor>(); |
- this->setTransformDataMatrix(gp.localMatrix(), pdman, index, transforms); |
+ SkSTArray<2, UniformTransform, true>& procTransforms = fInstalledTransforms[index]; |
+ int numTransforms = transforms.count(); |
+ for (int t = 0; t < numTransforms; ++t) { |
+ SkASSERT(procTransforms[t].fHandle.isValid()); |
+ const SkMatrix& transform = GetTransformMatrix(localMatrix, *transforms[t]); |
+ if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { |
+ pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform); |
+ procTransforms[t].fCurrentValue = transform; |
+ } |
+ } |
} |
// Emit a uniform matrix for each coord transform. |
@@ -96,22 +103,6 @@ protected: |
} |
private: |
- void setTransformDataMatrix(const SkMatrix& localMatrix, |
- const GrGLSLProgramDataManager& pdman, |
- int index, |
- const SkTArray<const GrCoordTransform*, true>& transforms) { |
- SkSTArray<2, UniformTransform, true>& procTransforms = fInstalledTransforms[index]; |
- int numTransforms = transforms.count(); |
- for (int t = 0; t < numTransforms; ++t) { |
- SkASSERT(procTransforms[t].fHandle.isValid()); |
- const SkMatrix& transform = GetTransformMatrix(localMatrix, *transforms[t]); |
- if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { |
- pdman.setSkMatrix(procTransforms[t].fHandle.toIndex(), transform); |
- procTransforms[t].fCurrentValue = transform; |
- } |
- } |
- } |
- |
virtual void onEmitCode(EmitArgs&, GrGPArgs*) = 0; |
struct UniformTransform : public Transform { |