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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 } | 165 } |
166 return true; | 166 return true; |
167 } | 167 } |
168 bool init(SkImageInfo info, Benchmark* bench) override { | 168 bool init(SkImageInfo info, Benchmark* bench) override { |
169 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde
pendentFonts_Flag : | 169 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde
pendentFonts_Flag : |
170 0; | 170 0; |
171 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 171 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
172 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType), | 172 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType), |
173 SkSurface::kNo_Budgeted
, info, | 173 SkSurface::kNo_Budgeted
, info, |
174 this->config.samples, &
props)); | 174 this->config.samples, &
props)); |
175 this->gl = gGrFactory->getGLContext(this->config.ctxType); | 175 this->gl = gGrFactory->getContextInfo(this->config.ctxType)->fGLContext; |
176 if (!this->surface.get()) { | 176 if (!this->surface.get()) { |
177 return false; | 177 return false; |
178 } | 178 } |
179 if (!this->gl->fenceSyncSupport()) { | 179 if (!this->gl->fenceSyncSupport()) { |
180 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " | 180 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " |
181 "Timings might not be accurate.\n", this->config.name); | 181 "Timings might not be accurate.\n", this->config.name); |
182 } | 182 } |
183 return true; | 183 return true; |
184 } | 184 } |
185 void fillOptions(ResultsWriter* log) override { | 185 void fillOptions(ResultsWriter* log) override { |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 | 1270 |
1271 return 0; | 1271 return 0; |
1272 } | 1272 } |
1273 | 1273 |
1274 #if !defined SK_BUILD_FOR_IOS | 1274 #if !defined SK_BUILD_FOR_IOS |
1275 int main(int argc, char** argv) { | 1275 int main(int argc, char** argv) { |
1276 SkCommandLineFlags::Parse(argc, argv); | 1276 SkCommandLineFlags::Parse(argc, argv); |
1277 return nanobench_main(); | 1277 return nanobench_main(); |
1278 } | 1278 } |
1279 #endif | 1279 #endif |
OLD | NEW |