Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: src/gpu/gl/GrGpuGL_program.cpp

Issue 647183002: Revert of Opt state takes a GP instead of a GeometryStage (Closed) Base URL: https://skia.googlesource.com/skia.git@builder_cleanup
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/gpu/gl/GrGpuGL.h ('k') | src/gpu/gl/builders/GrGLLegacyNvprProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698