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

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

Issue 805293003: Stop calling flushGLState in onStencilPath (Closed) Base URL: https://skia.googlesource.com/skia.git@flush
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGpuGL.cpp
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index 0c134ce35801eb0700f2afab47f4241fb78acd50..ed3385f4c7a3158666e74e922462edf2bdc0a989 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -1345,35 +1345,26 @@ void GrGLGpu::flushScissor(const GrClipMaskManager::ScissorState& scissorState,
}
bool GrGLGpu::flushGLState(const GrOptDrawState& optState) {
- // GrGpu::setupClipAndFlushState should have already checked this and bailed if not true.
- SkASSERT(optState.getRenderTarget());
-
- if (kStencilPath_DrawType == optState.drawType()) {
- const GrRenderTarget* rt = optState.getRenderTarget();
- SkISize size;
- size.set(rt->width(), rt->height());
- this->glPathRendering()->setProjectionMatrix(optState.getViewMatrix(), size, rt->origin());
- } else {
- this->flushMiscFixedFunctionState(optState);
+ SkASSERT(kStencilPath_DrawType != optState.drawType());
+ this->flushMiscFixedFunctionState(optState);
- fCurrentProgram.reset(fProgramCache->getProgram(optState));
- if (NULL == fCurrentProgram.get()) {
- SkDEBUGFAIL("Failed to create program!");
- return false;
- }
+ fCurrentProgram.reset(fProgramCache->getProgram(optState));
+ if (NULL == fCurrentProgram.get()) {
+ SkDEBUGFAIL("Failed to create program!");
+ return false;
+ }
- fCurrentProgram.get()->ref();
+ fCurrentProgram.get()->ref();
- GrGLuint programID = fCurrentProgram->programID();
- if (fHWProgramID != programID) {
- GL_CALL(UseProgram(programID));
- fHWProgramID = programID;
- }
+ GrGLuint programID = fCurrentProgram->programID();
+ if (fHWProgramID != programID) {
+ GL_CALL(UseProgram(programID));
+ fHWProgramID = programID;
+ }
- this->flushBlend(optState);
+ this->flushBlend(optState);
- fCurrentProgram->setData(optState);
- }
+ fCurrentProgram->setData(optState);
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(optState.getRenderTarget());
this->flushStencil(optState.getStencil(), optState.drawType());
@@ -1874,9 +1865,15 @@ void GrGLGpu::onDraw(const GrOptDrawState& ds, const GrDrawTarget::DrawInfo& inf
void GrGLGpu::onStencilPath(const GrOptDrawState& ds,
const GrPath* path,
const GrStencilSettings& stencil) {
- if (!this->flushGLState(ds)) {
- return;
- }
+ this->flushMiscFixedFunctionState(ds);
+ GrGLRenderTarget* rt = static_cast<GrGLRenderTarget*>(ds.getRenderTarget());
+ SkISize size = SkISize::Make(rt->width(), rt->height());
+ this->glPathRendering()->setProjectionMatrix(ds.getViewMatrix(), size, rt->origin());
+ this->flushStencil(ds.getStencil(), ds.drawType());
+ this->flushScissor(ds.getScissorState(), rt->getViewport(), rt->origin());
+ this->flushAAState(ds);
+ this->flushRenderTarget(rt, NULL);
+
fPathRendering->stencilPath(path, stencil);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698