Index: src/gpu/gl/GrGLProgramDesc.h |
diff --git a/src/gpu/gl/GrGLProgramDesc.h b/src/gpu/gl/GrGLProgramDesc.h |
index c8aae19503ff6a1654e5976112d07d6972c5dfad..d7652f473c6eddf75daf5d2aa0acd9ac29ff68ca 100644 |
--- a/src/gpu/gl/GrGLProgramDesc.h |
+++ b/src/gpu/gl/GrGLProgramDesc.h |
@@ -172,20 +172,14 @@ |
// 1. uint32_t for total key length. |
// 2. uint32_t for a checksum. |
// 3. Header struct defined above. |
- // 4. An array of offsets to effect keys and their sizes (see 5). uint16_t for each |
- // offset and size. |
+ // 4. uint32_t offsets to beginning of every effects' key (see 5). |
// 5. per-effect keys. Each effect's key is a variable length array of uint32_t. |
enum { |
- // Part 1. |
kLengthOffset = 0, |
- // Part 2. |
kChecksumOffset = kLengthOffset + sizeof(uint32_t), |
- // Part 3. |
kHeaderOffset = kChecksumOffset + sizeof(uint32_t), |
kHeaderSize = SkAlign4(sizeof(KeyHeader)), |
- // Part 4. |
- // This is the offset in the overall key to the array of per-effect offset,length pairs. |
- kEffectKeyOffsetsAndLengthOffset = kHeaderOffset + kHeaderSize, |
+ kEffectKeyLengthsOffset = kHeaderOffset + kHeaderSize, |
}; |
template<typename T, size_t OFFSET> T* atOffset() { |
@@ -199,16 +193,6 @@ |
typedef GrBackendEffectFactory::EffectKey EffectKey; |
KeyHeader* header() { return this->atOffset<KeyHeader, kHeaderOffset>(); } |
- |
- // Shared code between setRandom() and Build(). |
- static bool GetEffectKeyAndUpdateStats(const GrEffectStage& stage, |
- const GrGLCaps& caps, |
- bool useExplicitLocalCoords, |
- GrEffectKeyBuilder* b, |
- uint16_t* effectKeySize, |
- bool* setTrueIfReadsDst, |
- bool* setTrueIfReadsPos, |
- bool* setTrueIfHasVertexCode); |
void finalize(); |
@@ -228,11 +212,9 @@ |
} |
EffectKey get(int index) const { |
- const uint16_t* offsets = reinterpret_cast<const uint16_t*>( |
- fDesc->fKey.begin() + kEffectKeyOffsetsAndLengthOffset); |
- // We store two uint16_ts per effect, one for the offset to the effect's key and one for |
- // its length. Here we just need the offset. |
- uint16_t offset = offsets[2 * (fBaseIndex + index)]; |
+ const uint32_t* offsets = reinterpret_cast<const uint32_t*>(fDesc->fKey.begin() + |
+ kEffectKeyLengthsOffset); |
+ uint32_t offset = offsets[fBaseIndex + index]; |
return *reinterpret_cast<const EffectKey*>(fDesc->fKey.begin() + offset); |
} |
private: |
@@ -243,7 +225,7 @@ |
enum { |
kMaxPreallocEffects = 8, |
kIntsPerEffect = 4, // This is an overestimate of the average effect key size. |
- kPreAllocSize = kEffectKeyOffsetsAndLengthOffset + |
+ kPreAllocSize = kEffectKeyLengthsOffset + |
kMaxPreallocEffects * sizeof(uint32_t) * kIntsPerEffect, |
}; |