| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SK_COMMON_FLAGS_CONFIG_H | 8 #ifndef SK_COMMON_FLAGS_CONFIG_H |
| 9 #define SK_COMMON_FLAGS_CONFIG_H | 9 #define SK_COMMON_FLAGS_CONFIG_H |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 #if SK_SUPPORT_GPU | 46 #if SK_SUPPORT_GPU |
| 47 // SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out
of the backend | 47 // SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out
of the backend |
| 48 // part of the tag. It is constructed tags that have: | 48 // part of the tag. It is constructed tags that have: |
| 49 // * backends of form "gpu(option=value,option2=value,...)" | 49 // * backends of form "gpu(option=value,option2=value,...)" |
| 50 // * backends that represent a shorthand of above (such as "msaa16" representing
"gpu(samples=16)") | 50 // * backends that represent a shorthand of above (such as "msaa16" representing
"gpu(samples=16)") |
| 51 class SkCommandLineConfigGpu : public SkCommandLineConfig { | 51 class SkCommandLineConfigGpu : public SkCommandLineConfig { |
| 52 public: | 52 public: |
| 53 typedef sk_gpu_test::GrContextFactory::ContextType ContextType; | 53 typedef sk_gpu_test::GrContextFactory::ContextType ContextType; |
| 54 typedef sk_gpu_test::GrContextFactory::ContextOptions ContextOptions; |
| 54 SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaPar
ts, | 55 SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaPar
ts, |
| 55 ContextType contextType, bool useNVPR, bool useInstan
ced, bool useDIText, | 56 ContextType contextType, bool useNVPR, bool useInstan
ced, bool useDIText, |
| 56 int samples, SkColorType colorType, sk_sp<SkColorSpac
e> colorSpace); | 57 int samples, SkColorType colorType, sk_sp<SkColorSpac
e> colorSpace); |
| 57 const SkCommandLineConfigGpu* asConfigGpu() const override { return this; } | 58 const SkCommandLineConfigGpu* asConfigGpu() const override { return this; } |
| 58 ContextType getContextType() const { return fContextType; } | 59 ContextType getContextType() const { return fContextType; } |
| 59 bool getUseNVPR() const { return fUseNVPR; } | 60 ContextOptions getContextOptions() const { return fContextOptions; } |
| 60 bool getUseInstanced() const { return fUseInstanced; } | 61 bool getUseNVPR() const { return fContextOptions & ContextOptions::kEnableNV
PR; } |
| 62 bool getUseInstanced() const { return fContextOptions & ContextOptions::kUse
Instanced; } |
| 61 bool getUseDIText() const { return fUseDIText; } | 63 bool getUseDIText() const { return fUseDIText; } |
| 62 int getSamples() const { return fSamples; } | 64 int getSamples() const { return fSamples; } |
| 63 SkColorType getColorType() const { return fColorType; } | 65 SkColorType getColorType() const { return fColorType; } |
| 64 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } | 66 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } |
| 65 | 67 |
| 66 private: | 68 private: |
| 67 ContextType fContextType; | 69 ContextType fContextType; |
| 68 bool fUseNVPR; | 70 ContextOptions fContextOptions; |
| 69 bool fUseInstanced; | |
| 70 bool fUseDIText; | 71 bool fUseDIText; |
| 71 int fSamples; | 72 int fSamples; |
| 72 SkColorType fColorType; | 73 SkColorType fColorType; |
| 73 sk_sp<SkColorSpace> fColorSpace; | 74 sk_sp<SkColorSpace> fColorSpace; |
| 74 }; | 75 }; |
| 75 #endif | 76 #endif |
| 76 | 77 |
| 77 typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigAr
ray; | 78 typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigAr
ray; |
| 78 void ParseConfigs(const SkCommandLineFlags::StringArray& configList, | 79 void ParseConfigs(const SkCommandLineFlags::StringArray& configList, |
| 79 SkCommandLineConfigArray* outResult); | 80 SkCommandLineConfigArray* outResult); |
| 80 | 81 |
| 81 #endif | 82 #endif |
| OLD | NEW |