OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 <ctype.h> | 8 #include <ctype.h> |
9 | 9 |
10 #include "nanobench.h" | 10 #include "nanobench.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 *maxFrameLag = FLAGS_gpuFrameLag; | 178 *maxFrameLag = FLAGS_gpuFrameLag; |
179 } | 179 } |
180 return true; | 180 return true; |
181 } | 181 } |
182 bool init(SkImageInfo info, Benchmark* bench) override { | 182 bool init(SkImageInfo info, Benchmark* bench) override { |
183 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde
pendentFonts_Flag : | 183 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde
pendentFonts_Flag : |
184 0; | 184 0; |
185 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 185 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
186 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType, | 186 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType, |
187 this->con
fig.ctxOptions), | 187 this->con
fig.ctxOptions), |
188 SkBudgeted::kNo, info, | 188 SkSurface::kNo_Budgeted
, info, |
189 this->config.samples, &
props)); | 189 this->config.samples, &
props)); |
190 this->gl = gGrFactory->getContextInfo(this->config.ctxType, | 190 this->gl = gGrFactory->getContextInfo(this->config.ctxType, |
191 this->config.ctxOptions).fGLContex
t; | 191 this->config.ctxOptions).fGLContex
t; |
192 if (!this->surface.get()) { | 192 if (!this->surface.get()) { |
193 return false; | 193 return false; |
194 } | 194 } |
195 if (!this->gl->fenceSyncSupport()) { | 195 if (!this->gl->fenceSyncSupport()) { |
196 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " | 196 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " |
197 "Timings might not be accurate.\n", this->config.name.c_str
()); | 197 "Timings might not be accurate.\n", this->config.name.c_str
()); |
198 } | 198 } |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 | 1275 |
1276 return 0; | 1276 return 0; |
1277 } | 1277 } |
1278 | 1278 |
1279 #if !defined SK_BUILD_FOR_IOS | 1279 #if !defined SK_BUILD_FOR_IOS |
1280 int main(int argc, char** argv) { | 1280 int main(int argc, char** argv) { |
1281 SkCommandLineFlags::Parse(argc, argv); | 1281 SkCommandLineFlags::Parse(argc, argv); |
1282 return nanobench_main(); | 1282 return nanobench_main(); |
1283 } | 1283 } |
1284 #endif | 1284 #endif |
OLD | NEW |