Index: tests/GLProgramsTest.cpp |
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
index af280466ae12d2aad060e24fa74473b53711a9d3..f66f9e38f399b8791e5cea2f4231400665199c99 100644 |
--- a/tests/GLProgramsTest.cpp |
+++ b/tests/GLProgramsTest.cpp |
@@ -22,6 +22,19 @@ |
#include "SkRandom.h" |
#include "Test.h" |
+static void get_stage_stats(const GrEffectStage stage, bool* readsDst, |
+ bool* readsFragPosition, bool* requiresVertexShader) { |
+ if (stage.getEffect()->willReadDstColor()) { |
+ *readsDst = true; |
+ } |
+ if (stage.getEffect()->willReadFragmentPosition()) { |
+ *readsFragPosition = true; |
+ } |
+ if (stage.getEffect()->requiresVertexShader()) { |
+ *requiresVertexShader = true; |
+ } |
+} |
+ |
bool GrGLProgramDesc::setRandom(SkRandom* random, |
const GrGpuGL* gpu, |
const GrRenderTarget* dstRenderTarget, |
@@ -55,11 +68,11 @@ bool GrGLProgramDesc::setRandom(SkRandom* random, |
GrDrawEffect drawEffect(*stages[s], useLocalCoords); |
GrEffectKeyBuilder b(&fKey); |
uint16_t effectKeySize; |
- if (!GetEffectKeyAndUpdateStats(*stages[s], gpu->glCaps(), useLocalCoords, &b, |
- &effectKeySize, &dstRead, &fragPos, &vertexShader)) { |
+ if (!GetEffectKey(*stages[s], gpu->glCaps(), useLocalCoords, &b, &effectKeySize)) { |
fKey.reset(); |
return false; |
} |
+ get_stage_stats(*stages[s], &dstRead, &fragPos, &vertexShader); |
offsetAndSize[0] = effectKeyOffset; |
offsetAndSize[1] = effectKeySize; |
} |