Rename GrContextFactory::ContextOptions to ContextOverrides
Also changes the behavior of these flags to only override their
corresponding context options when set, and to leave them unchanged
when not set.
BUG=skia:
Change-Id: I09f6be09997594fa888d9045dd4901354ef3f880
Reviewed-on: https://skia-review.googlesource.com/8780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 2b80397..7336fa7 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -51,15 +51,19 @@
class SkCommandLineConfigGpu : public SkCommandLineConfig {
public:
typedef sk_gpu_test::GrContextFactory::ContextType ContextType;
- typedef sk_gpu_test::GrContextFactory::ContextOptions ContextOptions;
+ typedef sk_gpu_test::GrContextFactory::ContextOverrides ContextOverrides;
SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaParts,
ContextType contextType, bool useNVPR, bool useInstanced, bool useDIText,
int samples, SkColorType colorType, sk_sp<SkColorSpace> colorSpace);
const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
ContextType getContextType() const { return fContextType; }
- ContextOptions getContextOptions() const { return fContextOptions; }
- bool getUseNVPR() const { return fContextOptions & ContextOptions::kEnableNVPR; }
- bool getUseInstanced() const { return fContextOptions & ContextOptions::kUseInstanced; }
+ ContextOverrides getContextOverrides() const { return fContextOverrides; }
+ bool getUseNVPR() const {
+ SkASSERT(!(fContextOverrides & ContextOverrides::kRequireNVPRSupport) ||
+ !(fContextOverrides & ContextOverrides::kDisableNVPR));
+ return fContextOverrides & ContextOverrides::kRequireNVPRSupport;
+ }
+ bool getUseInstanced() const { return fContextOverrides & ContextOverrides::kUseInstanced; }
bool getUseDIText() const { return fUseDIText; }
int getSamples() const { return fSamples; }
SkColorType getColorType() const { return fColorType; }
@@ -67,7 +71,7 @@
private:
ContextType fContextType;
- ContextOptions fContextOptions;
+ ContextOverrides fContextOverrides;
bool fUseDIText;
int fSamples;
SkColorType fColorType;