Index: src/gpu/gl/GrGpuGL_program.cpp |
diff --git a/src/gpu/gl/GrGpuGL_program.cpp b/src/gpu/gl/GrGpuGL_program.cpp |
index 6a09ebf64e1564d03e0d54cd7cfed199630610d4..7dba5316a4e7afee640b9c4402ca2e1b07129148 100644 |
--- a/src/gpu/gl/GrGpuGL_program.cpp |
+++ b/src/gpu/gl/GrGpuGL_program.cpp |
@@ -93,7 +93,10 @@ |
GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrOptDrawState& optState, |
const GrGLProgramDesc& desc, |
- DrawType type) { |
+ DrawType type, |
+ const GrGeometryStage* geometryProcessor, |
+ const GrFragmentStage* colorStages[], |
+ const GrFragmentStage* coverageStages[]) { |
#ifdef PROGRAM_CACHE_STATS |
++fTotalRequests; |
#endif |
@@ -128,7 +131,9 @@ |
#ifdef PROGRAM_CACHE_STATS |
++fCacheMisses; |
#endif |
- GrGLProgram* program = GrGLProgramBuilder::CreateProgram(optState, desc, type, fGpu); |
+ GrGLProgram* program = GrGLProgramBuilder::CreateProgram(optState, desc, type, |
+ geometryProcessor, colorStages, |
+ coverageStages, fGpu); |
if (NULL == program) { |
return NULL; |
} |
@@ -232,13 +237,30 @@ |
return false; |
} |
+ const GrGeometryStage* geometryProcessor = NULL; |
+ SkSTArray<8, const GrFragmentStage*, true> colorStages; |
+ SkSTArray<8, const GrFragmentStage*, true> coverageStages; |
GrGLProgramDesc desc; |
- if (!GrGLProgramDesc::Build(*optState.get(), type, this, dstCopy, &desc)) { |
+ if (!GrGLProgramDesc::Build(*optState.get(), |
+ type, |
+ srcCoeff, |
+ dstCoeff, |
+ this, |
+ dstCopy, |
+ &geometryProcessor, |
+ &colorStages, |
+ &coverageStages, |
+ &desc)) { |
SkDEBUGFAIL("Failed to generate GL program descriptor"); |
return false; |
} |
- fCurrentProgram.reset(fProgramCache->getProgram(*optState.get(), desc, type)); |
+ fCurrentProgram.reset(fProgramCache->getProgram(*optState.get(), |
+ desc, |
+ type, |
+ geometryProcessor, |
+ colorStages.begin(), |
+ coverageStages.begin())); |
if (NULL == fCurrentProgram.get()) { |
SkDEBUGFAIL("Failed to create program!"); |
return false; |
@@ -254,7 +276,13 @@ |
this->flushBlend(*optState.get(), kDrawLines_DrawType == type, srcCoeff, dstCoeff); |
- fCurrentProgram->setData(*optState.get(), type, dstCopy, &fSharedGLProgramState); |
+ fCurrentProgram->setData(*optState.get(), |
+ type, |
+ geometryProcessor, |
+ colorStages.begin(), |
+ coverageStages.begin(), |
+ dstCopy, |
+ &fSharedGLProgramState); |
} |
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState->getRenderTarget()); |