aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/gpu/GrContextOptions.h7
-rw-r--r--src/gpu/GrContext.cpp3
2 files changed, 10 insertions, 0 deletions
diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h
index 11838707b5..d2377a570b 100644
--- a/include/gpu/GrContextOptions.h
+++ b/include/gpu/GrContextOptions.h
@@ -78,6 +78,13 @@ struct GrContextOptions {
bool fDoManualMipmapping = false;
/**
+ * Disables the coverage counting path renderer. Coverage counting can sometimes cause new
+ * rendering artifacts along shared edges if care isn't taken to ensure both contours wind in
+ * the same direction.
+ */
+ bool fDisableCoverageCountingPaths = false;
+
+ /**
* Disables distance field rendering for paths. Distance field computation can be expensive,
* and yields no benefit if a path is not rendered multiple times with different transforms.
*/
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 4b1af9991e..b4387e21a1 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -104,6 +104,9 @@ bool GrContext::initCommon(const GrContextOptions& options) {
#if GR_TEST_UTILS
prcOptions.fGpuPathRenderers = options.fGpuPathRenderers;
#endif
+ if (options.fDisableCoverageCountingPaths) {
+ prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kCoverageCounting;
+ }
if (options.fDisableDistanceFieldPaths) {
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;
}