diff options
author | 2017-10-18 08:33:29 -0400 | |
---|---|---|
committer | 2017-10-18 12:55:06 +0000 | |
commit | 43f8bf0f784f4182ed0fca9053ecf570caf7ad70 (patch) | |
tree | 2a705f6737fceb0d322d6a91d51b01160d68e844 /include | |
parent | 57caa660c024cf6fda5e1fba8cb21224b51375fe (diff) |
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 <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 3 | ||||
-rw-r--r-- | include/gpu/GrContextOptions.h | 17 |
2 files changed, 17 insertions, 3 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index 82a4be2c25..0b4c2e7ee5 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -55,8 +55,6 @@ public: bool usesMixedSamples() const { return fUsesMixedSamples; } bool preferClientSideDynamicBuffers() const { return fPreferClientSideDynamicBuffers; } - bool useDrawInsteadOfClear() const { return fUseDrawInsteadOfClear; } - bool preferVRAMUseOverFlushes() const { return fPreferVRAMUseOverFlushes; } /** @@ -210,7 +208,6 @@ protected: bool fMustClearUploadedBufferData : 1; // Driver workaround - bool fUseDrawInsteadOfClear : 1; bool fAvoidInstancedDrawsToFPTargets : 1; bool fBlacklistCoverageCounting : 1; bool fAvoidStencilBuffers : 1; 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. |