Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright 2015 Google Inc. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license that can be | |
| 5 * found in the LICENSE file. | |
| 6 */ | |
| 7 | |
| 8 #ifndef SK_COMMON_FLAGS_CONFIG_H | |
| 9 #define SK_COMMON_FLAGS_CONFIG_H | |
| 10 | |
| 11 #include "SkCommandLineFlags.h" | |
| 12 | |
| 13 #if SK_SUPPORT_GPU | |
| 14 #include "GrContextFactory.h" | |
| 15 #endif | |
| 16 | |
| 17 DECLARE_string(config); | |
| 18 | |
| 19 #if SK_SUPPORT_GPU | |
| 20 class SkCommandLineConfigGpu; | |
| 21 #endif | |
| 22 | |
| 23 // SkCommandLineConfig represents a Skia rendering configuration string. | |
| 24 // The string has following form: | |
| 25 // [via-]*tag | |
| 26 // where 'tag' consists of chars excluding hyphen or "angle-gl" | |
|
mtklein
2015/12/16 13:31:11
Have you considered calling this angle_gl so that
| |
| 27 // and each 'via' consists of chars excluding hyphen. | |
| 28 class SkCommandLineConfig { | |
| 29 public: | |
| 30 SkCommandLineConfig(const SkString& tag, const SkTArray<SkString>& viaParts) ; | |
| 31 virtual ~SkCommandLineConfig(); | |
| 32 #if SK_SUPPORT_GPU | |
| 33 virtual const SkCommandLineConfigGpu* asConfigGpu() const { return nullptr; } | |
| 34 #endif | |
| 35 const SkString& getTag() const { return fTag; } | |
| 36 const SkTArray<SkString>& getViaParts() const { return fViaParts; } | |
| 37 private: | |
| 38 SkString fTag; | |
| 39 SkTArray<SkString> fViaParts; | |
| 40 }; | |
| 41 | |
| 42 #if SK_SUPPORT_GPU | |
| 43 // SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out of the tag. It is | |
| 44 // constructed configs that have: | |
| 45 // * tags of form "gpu(option=value,option2=value,...)" | |
| 46 // * tags that represent a shorthand of above (such as "msaa16" representing "gp u(samples=16)") | |
| 47 class SkCommandLineConfigGpu : public SkCommandLineConfig { | |
| 48 public: | |
| 49 typedef GrContextFactory::GLContextType ContextType; | |
| 50 SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaPar ts, | |
| 51 ContextType contextType, bool useNVPR, bool useDIText , int samples); | |
| 52 const SkCommandLineConfigGpu* asConfigGpu() const override { return this; } | |
| 53 ContextType getContextType() const { return fContextType; } | |
| 54 bool getUseNVPR() const { return fUseNVPR; } | |
| 55 bool getUseDIText() const { return fUseDIText; } | |
| 56 int getSamples() const { return fSamples; } | |
| 57 | |
| 58 private: | |
| 59 ContextType fContextType; | |
| 60 bool fUseNVPR; | |
| 61 bool fUseDIText; | |
| 62 int fSamples; | |
| 63 }; | |
| 64 #endif | |
| 65 | |
| 66 typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigAr ray; | |
| 67 void ParseConfigs(const SkCommandLineFlags::StringArray& configList, | |
| 68 SkCommandLineConfigArray* outResult); | |
| 69 | |
| 70 #endif | |
| OLD | NEW |