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

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

Issue 1619623005: Avoid updating glPathStencilFunc unless it changes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months 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
« src/gpu/GrStencil.h ('K') | « src/gpu/GrStencil.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« src/gpu/GrStencil.h ('K') | « src/gpu/GrStencil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698