From 43f8bf0f784f4182ed0fca9053ecf570caf7ad70 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 18 Oct 2017 08:33:29 -0400 Subject: Move clear-as-draw workaround to GrGLGpu and expose via GrContextOptions. Bug: skia:7154 Change-Id: I23ffc11dab4a377fbd6b7e4e33722b3fa0793d58 Reviewed-on: https://skia-review.googlesource.com/60681 Commit-Queue: Brian Salomon Reviewed-by: Robert Phillips --- include/gpu/GrContextOptions.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'include/gpu/GrContextOptions.h') diff --git a/include/gpu/GrContextOptions.h b/include/gpu/GrContextOptions.h index 61dc8b0457..894813b5cc 100644 --- a/include/gpu/GrContextOptions.h +++ b/include/gpu/GrContextOptions.h @@ -15,6 +15,17 @@ class SkExecutor; struct GrContextOptions { + enum class Enable { + /** Forces an option to be disabled. */ + kNo, + /** Forces an option to be enabled. */ + kYes, + /** + * Uses Skia's default behavior, which may use runtime properties (e.g. driver version). + */ + kDefault + }; + GrContextOptions() {} // Suppress prints for the GrContext. @@ -88,6 +99,12 @@ struct GrContextOptions { */ bool fAvoidStencilBuffers = false; + /** + * Enables driver workaround to use draws instead of glClear. This only applies to + * kOpenGL_GrBackend. + */ + Enable fUseDrawInsteadOfGLClear = Enable::kDefault; + #if GR_TEST_UTILS /** * Private options that are only meant for testing within Skia's tools. -- cgit v1.2.3