diff options
author | csmartdalton <csmartdalton@google.com> | 2016-09-13 10:41:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-13 10:41:50 -0700 |
commit | 6270e558c31b75d02db6f598e93f2e3b701ccb7f (patch) | |
tree | 9c330b8761f62ef031f0913aaba00e74b2c91ea3 /tools/flags/SkCommonFlagsConfig.h | |
parent | 37283c28aa5bea2204c18956e74f83b238d7a891 (diff) |
Add ContextOptions field to SkCommandLineConfigGpu
Reduces duplicate code by computing the ContextOptions in one spot.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2337163002
Review-Url: https://codereview.chromium.org/2337163002
Diffstat (limited to 'tools/flags/SkCommonFlagsConfig.h')
-rw-r--r-- | tools/flags/SkCommonFlagsConfig.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h index 641c68b3ee..e817339c6e 100644 --- a/tools/flags/SkCommonFlagsConfig.h +++ b/tools/flags/SkCommonFlagsConfig.h @@ -51,13 +51,15 @@ class SkCommandLineConfig { class SkCommandLineConfigGpu : public SkCommandLineConfig { public: typedef sk_gpu_test::GrContextFactory::ContextType ContextType; + typedef sk_gpu_test::GrContextFactory::ContextOptions ContextOptions; 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; } - bool getUseNVPR() const { return fUseNVPR; } - bool getUseInstanced() const { return fUseInstanced; } + ContextOptions getContextOptions() const { return fContextOptions; } + bool getUseNVPR() const { return fContextOptions & ContextOptions::kEnableNVPR; } + bool getUseInstanced() const { return fContextOptions & ContextOptions::kUseInstanced; } bool getUseDIText() const { return fUseDIText; } int getSamples() const { return fSamples; } SkColorType getColorType() const { return fColorType; } @@ -65,8 +67,7 @@ class SkCommandLineConfigGpu : public SkCommandLineConfig { private: ContextType fContextType; - bool fUseNVPR; - bool fUseInstanced; + ContextOptions fContextOptions; bool fUseDIText; int fSamples; SkColorType fColorType; |