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). |