aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Eric Karl <ericrk@chromium.org>2017-05-08 12:02:07 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-09 17:41:25 +0000
commit5c77975e4c00e18e644c72b56f369858acd11b15 (patch)
tree187dff83863784225a9f2aa4d8c5abacefc12ec0 /include
parentfda4600e41ded0b8f0a54222e2dc8a85d53b4121 (diff)
Add flag to avoid stencil buffers in Skia
Certain systems experience a leak in the GL driver associated with stencil buffers. Attempts to avoid the leak (while still using stencil buffers) dind't succeed. This patch adds a GrContextOption fAvoidStencilBuffers. This disables certain path rendering modes, as well as stencil based masking/clipping. Bug: 713854 Change-Id: Ifa6c0f2bd5ee395547bda9165d6c79d197ae8b8b Reviewed-on: https://skia-review.googlesource.com/15253 Commit-Queue: Eric Karl <ericrk@chromium.org> Reviewed-by: Eric Karl <ericrk@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/gpu/GrCaps.h3
-rw-r--r--include/gpu/GrContextOptions.h6
2 files changed, 9 insertions, 0 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 92171204b3..17b5a23e18 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -79,6 +79,8 @@ public:
bool avoidInstancedDrawsToFPTargets() const { return fAvoidInstancedDrawsToFPTargets; }
+ bool avoidStencilBuffers() const { return fAvoidStencilBuffers; }
+
/**
* Indicates the capabilities of the fixed function blend unit.
*/
@@ -225,6 +227,7 @@ protected:
bool fUseDrawInsteadOfPartialRenderTargetWrite : 1;
bool fUseDrawInsteadOfAllRenderTargetWrites : 1;
bool fAvoidInstancedDrawsToFPTargets : 1;
+ bool fAvoidStencilBuffers : 1;
// ANGLE workaround
bool fPreferVRAMUseOverFlushes : 1;
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h
index 2e43e426af..d74f10ff63 100644
--- a/include/gpu/GrContextOptions.h
+++ b/include/gpu/GrContextOptions.h
@@ -110,6 +110,12 @@ struct GrContextOptions {
* The maximum size of cache textures used for Skia's Glyph cache.
*/
float fGlyphCacheTextureMaximumBytes = 2048 * 1024 * 4;
+
+ /**
+ * Bugs on certain drivers cause stencil buffers to leak. This flag causes Skia to avoid
+ * allocating stencil buffers and use alternate rasterization paths, avoiding the leak.
+ */
+ bool fAvoidStencilBuffers = false;
};
GR_MAKE_BITFIELD_CLASS_OPS(GrContextOptions::GpuPathRenderers)