Index: src/gpu/gl/GrGLPathRendering.cpp |
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp |
index 3cfec749acbdfb92b79be253c4dd59da15fe7131..69c98075c3364ea395f1b3d024de8f60a84b0f36 100644 |
--- a/src/gpu/gl/GrGLPathRendering.cpp |
+++ b/src/gpu/gl/GrGLPathRendering.cpp |
@@ -293,11 +293,17 @@ void GrGLPathRendering::flushPathStencilSettings(const GrStencilSettings& stenci |
if (fHWPathStencilSettings != stencilSettings) { |
// Just the func, ref, and mask is set here. The op and write mask are params to the call |
// that draws the path to the SB (glStencilFillPath) |
- GrGLenum func = |
- GrToGLStencilFunc(stencilSettings.func(GrStencilSettings::kFront_Face)); |
- GL_CALL(PathStencilFunc(func, stencilSettings.funcRef(GrStencilSettings::kFront_Face), |
- stencilSettings.funcMask(GrStencilSettings::kFront_Face))); |
- |
+ const GrStencilSettings::Face kFace = GrStencilSettings::kFront_Face; |
+ GrStencilFunc func = stencilSettings.func(kFace); |
+ uint16_t funcRef = stencilSettings.funcRef(kFace); |
+ uint16_t funcMask = stencilSettings.funcMask(kFace); |
+ |
+ if (!fHWPathStencilSettings.isValid() || |
+ func != fHWPathStencilSettings.func(kFace) || |
+ funcRef != fHWPathStencilSettings.funcRef(kFace) || |
+ funcMask != fHWPathStencilSettings.funcMask(kFace)) { |
+ GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask)); |
+ } |
fHWPathStencilSettings = stencilSettings; |
} |
} |