Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 454753c4e927d23fe7cd6a7a946a0e2c78d69226..6d50ee29c4e878b97cdd77725d24e9a01d8c48f1 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -2052,10 +2052,17 @@ bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcesso |
program->setData(primProc, pipeline); |
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget()); |
- this->flushStencil(pipeline.getStencil()); |
+ GrStencilSettings stencil; |
+ if (pipeline.isStencilEnabled()) { |
+ // TODO: attach stencil and create settings during render target flush. |
+ SkASSERT(glRT->renderTargetPriv().getStencilAttachment()); |
+ stencil.reset(*pipeline.getUserStencil(), pipeline.hasStencilClip(), |
+ glRT->renderTargetPriv().numStencilBits()); |
+ } |
+ this->flushStencil(stencil); |
this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->origin()); |
this->flushWindowRectangles(pipeline.getWindowRectsState(), glRT); |
- this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStencil().isDisabled()); |
+ this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), stencil.isDisabled()); |
// This must come after textures are flushed because a texture may need |
// to be msaa-resolved (which will modify bound FBO state). |