Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: tools/flags/SkCommonFlagsConfig.h

Issue 1490113005: Add config options to run different GPU APIs to dm and nanobench (Closed) Base URL: https://skia.googlesource.com/skia.git@commandbuffer-as-api-03-context-factory-glcontext-type
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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 DECLARE_string(config);
14
15 class SkCommandLineConfigGpu;
16 // SkCommandLineConfig represents a Skia rendering configuration string.
17 // The string has following form:
18 // [via-]*tag
19 // where 'tag' consists of chars excluding hyphen or "angle-gl"
20 // and each 'via' consists of chars excluding hyphen.
21 class SkCommandLineConfig {
22 public:
23 SkCommandLineConfig(const SkString& tag, const SkTArray<SkString>& viaParts) ;
24 virtual ~SkCommandLineConfig();
25 #if SK_SUPPORT_GPU
26 virtual const SkCommandLineConfigGpu* asConfigGpu() const { return nullptr; }
27 #endif
28 const SkString& getTag() const { return fTag; }
29 const SkTArray<SkString>& getViaParts() const { return fViaParts; }
30 private:
31 SkString fTag;
32 SkTArray<SkString> fViaParts;
33 };
34
35 #if SK_SUPPORT_GPU
36 // SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out of the tag. It is
37 // constructed configs that have:
38 // * tags of form "gpu(option=value,option2=value,...)"
39 // * tags that represent a shorthand of above (such as "msaa16" representing "gp u(samples=16)")
40 class SkCommandLineConfigGpu : public SkCommandLineConfig {
41 public:
42 enum API {
43 kNative_API,
44 kGL_API,
45 kGLES_API,
46 #if SK_ANGLE
47 kANGLE_API,
48 kANGLE_GL_API,
49 #endif
50 #if SK_COMMAND_BUFFER
51 kCommandBuffer_API,
52 #endif
53 #if SK_MESA
54 kMESA_API,
55 #endif
56 kDebug_API,
57 kNull_API
58 };
59
60 SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaPar ts, API api, bool useNVPR, bool useDIText, int samples);
61 const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
62 API getAPI() const { return fAPI; }
63 bool getUseNVPR() const { return fUseNVPR; }
64 bool getUseDIText() const { return fUseDIText; }
65 int getSamples() const { return fSamples; }
66
67 private:
68 API fAPI;
69 bool fUseNVPR;
70 bool fUseDIText;
71 int fSamples;
72 };
73 #endif
74
75 typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigAr ray;
76 void ParseConfigs(const SkCommandLineFlags::StringArray& configList, SkCommandLi neConfigArray* outResult);
77
78 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698