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

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: win angle 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;
scroggo 2015/12/03 19:02:59 Should this be in #if SK_SUPPORT_GPU?
Kimmo Kinnunen 2015/12/04 14:26:19 Done.
16 // SkCommandLineConfig represents a Skia rendering configuration string.
scroggo 2015/12/03 19:02:59 nit: newline before comment block
Kimmo Kinnunen 2015/12/04 14:26:19 Done.
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 #if SK_BUILD_FOR_WIN
48 kANGLE_API,
49 #endif
50 kANGLE_GL_API,
51 #endif
52 #if SK_COMMAND_BUFFER
53 kCommandBuffer_API,
54 #endif
55 #if SK_MESA
56 kMESA_API,
57 #endif
58 kDebug_API,
59 kNull_API
60 };
61
62 SkCommandLineConfigGpu(const SkString& tag, const SkTArray<SkString>& viaPar ts, API api, bool useNVPR, bool useDIText, int samples);
scroggo 2015/12/03 19:02:59 100 chars
Kimmo Kinnunen 2015/12/04 14:26:19 Done.
63 const SkCommandLineConfigGpu* asConfigGpu() const override { return this; }
64 API getAPI() const { return fAPI; }
65 bool getUseNVPR() const { return fUseNVPR; }
66 bool getUseDIText() const { return fUseDIText; }
67 int getSamples() const { return fSamples; }
68
69 private:
70 API fAPI;
71 bool fUseNVPR;
72 bool fUseDIText;
73 int fSamples;
74 };
75 #endif
76
77 typedef SkTArray<SkAutoTDelete<SkCommandLineConfig>, true> SkCommandLineConfigAr ray;
78 void ParseConfigs(const SkCommandLineFlags::StringArray& configList, SkCommandLi neConfigArray* outResult);
scroggo 2015/12/03 19:02:59 100 chars
Kimmo Kinnunen 2015/12/04 14:26:19 Done.
79
80 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698