Chromium Code Reviews| Index: src/gpu/gl/GrGpuGL.cpp |
| diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
| index c83a668ea38cfe6d95dfe3fe9213ac1f9b6d378b..3589c9579b6753b69087dfe876ea79c71b072710 100644 |
| --- a/src/gpu/gl/GrGpuGL.cpp |
| +++ b/src/gpu/gl/GrGpuGL.cpp |
| @@ -1904,9 +1904,10 @@ void set_gl_stencil(const GrGLInterface* gl, |
| } |
| } |
| -void GrGpuGL::flushStencil(DrawType type) { |
| - if (kStencilPath_DrawType != type && fHWStencilSettings != fStencilSettings) { |
| - if (fStencilSettings.isDisabled()) { |
| +void GrGpuGL::flushStencil(const GrOptDrawState& optState, DrawType type) { |
|
bsalomon
2014/10/24 21:04:38
might make sense to just pass stencil settings obj
|
| + const GrStencilSettings& stencilSettings = optState.getStencil(); |
| + if (kStencilPath_DrawType != type && fHWStencilSettings != stencilSettings) { |
| + if (stencilSettings.isDisabled()) { |
| if (kNo_TriState != fHWStencilTestEnabled) { |
| GL_CALL(Disable(GR_GL_STENCIL_TEST)); |
| fHWStencilTestEnabled = kNo_TriState; |
| @@ -1917,24 +1918,24 @@ void GrGpuGL::flushStencil(DrawType type) { |
| fHWStencilTestEnabled = kYes_TriState; |
| } |
| } |
| - if (!fStencilSettings.isDisabled()) { |
| + if (!stencilSettings.isDisabled()) { |
| if (this->caps()->twoSidedStencilSupport()) { |
| set_gl_stencil(this->glInterface(), |
| - fStencilSettings, |
| + stencilSettings, |
| GR_GL_FRONT, |
| GrStencilSettings::kFront_Face); |
| set_gl_stencil(this->glInterface(), |
| - fStencilSettings, |
| + stencilSettings, |
| GR_GL_BACK, |
| GrStencilSettings::kBack_Face); |
| } else { |
| set_gl_stencil(this->glInterface(), |
| - fStencilSettings, |
| + stencilSettings, |
| GR_GL_FRONT_AND_BACK, |
| GrStencilSettings::kFront_Face); |
| } |
| } |
| - fHWStencilSettings = fStencilSettings; |
| + fHWStencilSettings = stencilSettings; |
| } |
| } |