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

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

Issue 777673003: move program descriptor generation to flush (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix builder bug Created 6 years 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.cpp ('k') | src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp » ('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 cb8810cc79600450945d8db98f2c11079ff5710f..a808aa8dda7ccf397006158b719f2f835b1eef92 100644
--- a/src/gpu/gl/GrGpuGL_program.cpp
+++ b/src/gpu/gl/GrGpuGL_program.cpp
@@ -91,7 +91,7 @@ int GrGpuGL::ProgramCache::search(const GrProgramDesc& desc) const {
return SkTSearch(fEntries, fCount, desc, sizeof(Entry*), less);
}
-GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrOptDrawState& optState, DrawType type) {
+GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrOptDrawState& optState) {
#ifdef PROGRAM_CACHE_STATS
++fTotalRequests;
#endif
@@ -126,7 +126,7 @@ GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrOptDrawState& optState, D
#ifdef PROGRAM_CACHE_STATS
++fCacheMisses;
#endif
- GrGLProgram* program = GrGLProgramBuilder::CreateProgram(optState, type, fGpu);
+ GrGLProgram* program = GrGLProgramBuilder::CreateProgram(optState, fGpu);
if (NULL == program) {
return NULL;
}
@@ -201,11 +201,11 @@ GrGLProgram* GrGpuGL::ProgramCache::getProgram(const GrOptDrawState& optState, D
#define GL_CALL(X) GR_GL_CALL(this->glInterface(), X)
-bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState, DrawType type) {
+bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState) {
// GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
SkASSERT(optState.getRenderTarget());
- if (kStencilPath_DrawType == type) {
+ if (kStencilPath_DrawType == optState.drawType()) {
const GrRenderTarget* rt = optState.getRenderTarget();
SkISize size;
size.set(rt->width(), rt->height());
@@ -216,7 +216,7 @@ bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState, DrawType type)
GrBlendCoeff srcCoeff = optState.getSrcBlendCoeff();
GrBlendCoeff dstCoeff = optState.getDstBlendCoeff();
- fCurrentProgram.reset(fProgramCache->getProgram(optState, type));
+ fCurrentProgram.reset(fProgramCache->getProgram(optState));
if (NULL == fCurrentProgram.get()) {
SkDEBUGFAIL("Failed to create program!");
return false;
@@ -230,15 +230,15 @@ bool GrGpuGL::flushGraphicsState(const GrOptDrawState& optState, DrawType type)
fHWProgramID = programID;
}
- this->flushBlend(optState, kDrawLines_DrawType == type, srcCoeff, dstCoeff);
+ this->flushBlend(optState, kDrawLines_DrawType == optState.drawType(), srcCoeff, dstCoeff);
- fCurrentProgram->setData(optState, type);
+ fCurrentProgram->setData(optState);
}
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState.getRenderTarget());
- this->flushStencil(optState.getStencil(), type);
+ this->flushStencil(optState.getStencil(), optState.drawType());
this->flushScissor(optState.getScissorState(), glRT->getViewport(), glRT->origin());
- this->flushAAState(optState, type);
+ this->flushAAState(optState);
// This must come after textures are flushed because a texture may need
// to be msaa-resolved (which will modify bound FBO state).
« no previous file with comments | « src/gpu/gl/GrGpuGL.cpp ('k') | src/gpu/gl/builders/GrGLGeometryShaderBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698