Index: src/gpu/gl/GrGLProgramDesc.h |
diff --git a/src/gpu/gl/GrGLProgramDesc.h b/src/gpu/gl/GrGLProgramDesc.h |
index 4796d5a4b3ae1b7df23489fb55595bf5655fa83b..a4e75519dfdd86c6e10bc44a74258ffb2d37578d 100644 |
--- a/src/gpu/gl/GrGLProgramDesc.h |
+++ b/src/gpu/gl/GrGLProgramDesc.h |
@@ -48,6 +48,7 @@ public: |
const GrGpuGL* gpu, |
const GrRenderTarget* dummyDstRenderTarget, |
const GrTexture* dummyDstCopyTexture, |
+ const GrEffectStage* geometryProcessor, |
const GrEffectStage* stages[], |
int numColorStages, |
int numCoverageStages, |
@@ -67,10 +68,15 @@ public: |
GrBlendCoeff dstCoeff, |
const GrGpuGL* gpu, |
const GrDeviceCoordTexture* dstCopy, |
+ const GrEffectStage** outGeometryProcessor, |
SkTArray<const GrEffectStage*, true>* outColorStages, |
SkTArray<const GrEffectStage*, true>* outCoverageStages, |
GrGLProgramDesc* outDesc); |
+ bool hasGeometryProcessor() const { |
+ return this->getHeader().fHasGeometryProcessor; |
+ } |
+ |
int numColorEffects() const { |
return this->getHeader().fColorEffectCnt; |
} |
@@ -161,6 +167,9 @@ private: |
int8_t fColorAttributeIndex; |
int8_t fCoverageAttributeIndex; |
+ SkBool8 fSeparateCoverageFromColor; |
bsalomon
2014/08/29 15:07:25
eek! What's this for?
joshua.litt
2014/09/02 16:06:21
I might have done something dumb. Basically, I us
|
+ |
+ SkBool8 fHasGeometryProcessor; |
int8_t fColorEffectCnt; |
int8_t fCoverageEffectCnt; |
}; |
@@ -213,13 +222,24 @@ private: |
class EffectKeyProvider { |
public: |
enum EffectType { |
+ kGeometryProcessor_EffectType, |
kColor_EffectType, |
kCoverage_EffectType, |
}; |
EffectKeyProvider(const GrGLProgramDesc* desc, EffectType type) : fDesc(desc) { |
- // Coverage effect key offsets begin immediately after those of the color effects. |
- fBaseIndex = kColor_EffectType == type ? 0 : desc->numColorEffects(); |
+ switch (type) { |
+ case kGeometryProcessor_EffectType: |
+ // there can be only one |
+ fBaseIndex = 0; |
+ break; |
+ case kColor_EffectType: |
+ fBaseIndex = desc->hasGeometryProcessor() ? 1 : 0; |
+ break; |
+ case kCoverage_EffectType: |
+ fBaseIndex = desc->numColorEffects() + (desc->hasGeometryProcessor() ? 1 : 0); |
+ break; |
+ } |
} |
GrEffectKey get(int index) const { |