Index: tests/GLProgramsTest.cpp |
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp |
index 2264385902b3471f65576540c3ffc1a3f28521cc..dd0f80f42f0815aa8b7c7c91c5c9da01ced9cbda 100644 |
--- a/tests/GLProgramsTest.cpp |
+++ b/tests/GLProgramsTest.cpp |
@@ -35,33 +35,42 @@ |
int numStages = numColorStages + numCoverageStages; |
fKey.reset(); |
- GR_STATIC_ASSERT(0 == kEffectKeyOffsetsAndLengthOffset % sizeof(uint32_t)); |
+ GR_STATIC_ASSERT(0 == kEffectKeyLengthsOffset % sizeof(uint32_t)); |
// Make room for everything up to and including the array of offsets to effect keys. |
- fKey.push_back_n(kEffectKeyOffsetsAndLengthOffset + 2 * sizeof(uint16_t) * numStages); |
+ fKey.push_back_n(kEffectKeyLengthsOffset + sizeof(uint32_t) * numStages); |
+ |
+ size_t offset = fKey.count(); |
+ int offsetIndex = 0; |
bool dstRead = false; |
bool fragPos = false; |
bool vertexCode = false; |
for (int s = 0; s < numStages; ++s) { |
- uint16_t* offsetAndSize = reinterpret_cast<uint16_t*>(fKey.begin() + |
- kEffectKeyOffsetsAndLengthOffset + |
- s * 2 * sizeof(uint16_t)); |
- uint32_t effectKeyOffset = fKey.count(); |
- if (effectKeyOffset > SK_MaxU16) { |
+ uint32_t* offsetLocation = reinterpret_cast<uint32_t*>(fKey.begin() + |
+ kEffectKeyLengthsOffset + |
+ offsetIndex * sizeof(uint32_t)); |
+ *offsetLocation = offset; |
+ ++offsetIndex; |
+ |
+ const GrBackendEffectFactory& factory = stages[s]->getEffect()->getFactory(); |
+ GrDrawEffect drawEffect(*stages[s], useLocalCoords); |
+ GrEffectKeyBuilder b(&fKey); |
+ if (!factory.getGLEffectKey(drawEffect, gpu->glCaps(), &b)) { |
fKey.reset(); |
return false; |
} |
- GrDrawEffect drawEffect(*stages[s], useLocalCoords); |
- GrEffectKeyBuilder b(&fKey); |
- uint16_t effectKeySize; |
- if (!GetEffectKeyAndUpdateStats(*stages[s], gpu->glCaps(), useLocalCoords, &b, |
- &effectKeySize, &dstRead, &fragPos, &vertexCode)) { |
- fKey.reset(); |
- return false; |
- } |
- offsetAndSize[0] = effectKeyOffset; |
- offsetAndSize[1] = effectKeySize; |
+ if (stages[s]->getEffect()->willReadDstColor()) { |
+ dstRead = true; |
+ } |
+ if (stages[s]->getEffect()->willReadFragmentPosition()) { |
+ fragPos = true; |
+ } |
+ if (stages[s]->getEffect()->hasVertexCode()) { |
+ vertexCode = true; |
+ } |
+ |
+ offset += b.size(); |
} |
KeyHeader* header = this->header(); |