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

Side by Side Diff: tests/TestConfigParsing.cpp

Issue 1553453004: Use device-independent text for nvprmsaa4/16 in nanobench and dm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months 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
« no previous file with comments | « no previous file | tools/flags/SkCommonFlagsConfig.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "SkCommonFlagsConfig.h" 8 #include "SkCommonFlagsConfig.h"
9 #include "Test.h" 9 #include "Test.h"
10 #include <initializer_list> 10 #include <initializer_list>
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 REPORTER_ASSERT(reporter, configs[4]->asConfigGpu()); 84 REPORTER_ASSERT(reporter, configs[4]->asConfigGpu());
85 REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getUseDIText()); 85 REPORTER_ASSERT(reporter, configs[5]->asConfigGpu()->getUseDIText());
86 REPORTER_ASSERT(reporter, configs[6]->asConfigGpu()); 86 REPORTER_ASSERT(reporter, configs[6]->asConfigGpu());
87 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getSamples() == 16); 87 REPORTER_ASSERT(reporter, configs[7]->asConfigGpu()->getSamples() == 16);
88 REPORTER_ASSERT(reporter, configs[8]->asConfigGpu()->getSamples() == 4); 88 REPORTER_ASSERT(reporter, configs[8]->asConfigGpu()->getSamples() == 4);
89 REPORTER_ASSERT(reporter, !configs[9]->asConfigGpu()); 89 REPORTER_ASSERT(reporter, !configs[9]->asConfigGpu());
90 REPORTER_ASSERT(reporter, !configs[10]->asConfigGpu()); 90 REPORTER_ASSERT(reporter, !configs[10]->asConfigGpu());
91 REPORTER_ASSERT(reporter, configs[11]->asConfigGpu()); 91 REPORTER_ASSERT(reporter, configs[11]->asConfigGpu());
92 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getSamples() == 16); 92 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getSamples() == 16);
93 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getUseNVPR()); 93 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getUseNVPR());
94 REPORTER_ASSERT(reporter, configs[12]->asConfigGpu()->getUseDIText());
94 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getSamples() == 4); 95 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getSamples() == 4);
95 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getUseNVPR()); 96 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getUseNVPR());
97 REPORTER_ASSERT(reporter, configs[13]->asConfigGpu()->getUseDIText());
96 REPORTER_ASSERT(reporter, !configs[14]->asConfigGpu()); 98 REPORTER_ASSERT(reporter, !configs[14]->asConfigGpu());
97 REPORTER_ASSERT(reporter, !configs[15]->asConfigGpu()); 99 REPORTER_ASSERT(reporter, !configs[15]->asConfigGpu());
98 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu()); 100 REPORTER_ASSERT(reporter, !configs[16]->asConfigGpu());
99 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu()); 101 REPORTER_ASSERT(reporter, !configs[17]->asConfigGpu());
100 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu()); 102 REPORTER_ASSERT(reporter, !configs[18]->asConfigGpu());
101 REPORTER_ASSERT(reporter, !configs[23]->asConfigGpu()); 103 REPORTER_ASSERT(reporter, !configs[23]->asConfigGpu());
102 #if SK_ANGLE 104 #if SK_ANGLE
103 #ifdef SK_BUILD_FOR_WIN 105 #ifdef SK_BUILD_FOR_WIN
104 REPORTER_ASSERT(reporter, configs[19]->asConfigGpu()); 106 REPORTER_ASSERT(reporter, configs[19]->asConfigGpu());
105 #else 107 #else
(...skipping 12 matching lines...) Expand all
118 #if SK_MESA 120 #if SK_MESA
119 REPORTER_ASSERT(reporter, configs[22]->asConfigGpu()); 121 REPORTER_ASSERT(reporter, configs[22]->asConfigGpu());
120 #else 122 #else
121 REPORTER_ASSERT(reporter, !configs[22]->asConfigGpu()); 123 REPORTER_ASSERT(reporter, !configs[22]->asConfigGpu());
122 #endif 124 #endif
123 #endif 125 #endif
124 } 126 }
125 127
126 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { 128 DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) {
127 SkCommandLineFlags::StringArray config1 = make_string_array({ 129 SkCommandLineFlags::StringArray config1 = make_string_array({
128 "gpu(nvpr=true,dit=true)", 130 "gpu(nvpr=true,dit=false)",
129 "gpu(api=angle)", 131 "gpu(api=angle)",
130 "gpu(api=angle-gl)", 132 "gpu(api=angle-gl)",
131 "gpu(api=mesa,samples=77)", 133 "gpu(api=mesa,samples=77)",
132 "gpu(dit=true,api=commandbuffer)", 134 "gpu(dit=true,api=commandbuffer)",
133 "gpu()", 135 "gpu()",
134 "gpu(api=gles)" 136 "gpu(api=gles)"
135 }); 137 });
136 138
137 SkCommandLineConfigArray configs; 139 SkCommandLineConfigArray configs;
138 ParseConfigs(config1, &configs); 140 ParseConfigs(config1, &configs);
139 REPORTER_ASSERT(reporter, configs.count() == config1.count()); 141 REPORTER_ASSERT(reporter, configs.count() == config1.count());
140 for (int i = 0; i < config1.count(); ++i) { 142 for (int i = 0; i < config1.count(); ++i) {
141 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i])); 143 REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
142 } 144 }
143 #if SK_SUPPORT_GPU 145 #if SK_SUPPORT_GPU
144 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() == 146 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() ==
145 GrContextFactory::kNative_GLContextType); 147 GrContextFactory::kNative_GLContextType);
146 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR()); 148 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR());
147 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseDIText()); 149 REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu()->getUseDIText());
148 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0); 150 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSamples() == 0);
149 #if SK_ANGLE 151 #if SK_ANGLE
150 #ifdef SK_BUILD_FOR_WIN 152 #ifdef SK_BUILD_FOR_WIN
151 REPORTER_ASSERT(reporter, configs[1]->asConfigGpu()->getContextType() == 153 REPORTER_ASSERT(reporter, configs[1]->asConfigGpu()->getContextType() ==
152 GrContextFactory::kANGLE_GLContextType); 154 GrContextFactory::kANGLE_GLContextType);
153 #else 155 #else
154 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); 156 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
155 #endif 157 #endif
156 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()->getContextType() == 158 REPORTER_ASSERT(reporter, configs[2]->asConfigGpu()->getContextType() ==
157 GrContextFactory::kANGLE_GL_GLContextType); 159 GrContextFactory::kANGLE_GL_GLContextType);
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 REPORTER_ASSERT(reporter, 307 REPORTER_ASSERT(reporter,
306 configs[i]->getViaParts()[j].equals(expectedConfigs[ i].vias[j])); 308 configs[i]->getViaParts()[j].equals(expectedConfigs[ i].vias[j]));
307 } 309 }
308 } 310 }
309 #if SK_SUPPORT_GPU 311 #if SK_SUPPORT_GPU
310 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()); 312 REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
311 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu()); 313 REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
312 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu()); 314 REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
313 #endif 315 #endif
314 } 316 }
OLDNEW
« no previous file with comments | « no previous file | tools/flags/SkCommonFlagsConfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698