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

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: eh 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
« no previous file with comments | « 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..7fb85352fb5b00aa2db7283745666ba44f3ccd8f 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -291,13 +291,20 @@ void GrGLPathRendering::deletePaths(GrGLuint path, GrGLsizei range) {
void GrGLPathRendering::flushPathStencilSettings(const GrStencilSettings& stencilSettings) {
if (fHWPathStencilSettings != stencilSettings) {
+ SkASSERT(stencilSettings.isValid());
// 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 kFront_Face = GrStencilSettings::kFront_Face;
+ GrStencilFunc func = stencilSettings.func(kFront_Face);
+ uint16_t funcRef = stencilSettings.funcRef(kFront_Face);
+ uint16_t funcMask = stencilSettings.funcMask(kFront_Face);
+
+ if (!fHWPathStencilSettings.isValid() ||
+ func != fHWPathStencilSettings.func(kFront_Face) ||
+ funcRef != fHWPathStencilSettings.funcRef(kFront_Face) ||
+ funcMask != fHWPathStencilSettings.funcMask(kFront_Face)) {
+ GL_CALL(PathStencilFunc(GrToGLStencilFunc(func), funcRef, funcMask));
+ }
fHWPathStencilSettings = stencilSettings;
}
}
« no previous file with comments | « src/gpu/GrStencil.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698