diff options
author | Eric Karl <ericrk@chromium.org> | 2017-05-08 12:02:07 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-05-09 17:41:25 +0000 |
commit | 5c77975e4c00e18e644c72b56f369858acd11b15 (patch) | |
tree | 187dff83863784225a9f2aa4d8c5abacefc12ec0 /include/gpu | |
parent | fda4600e41ded0b8f0a54222e2dc8a85d53b4121 (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/gpu')
-rw-r--r-- | include/gpu/GrCaps.h | 3 | ||||
-rw-r--r-- | include/gpu/GrContextOptions.h | 6 |
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) |