| 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool needsFrameTiming(int* maxFrameLag) const override { | 162 bool needsFrameTiming(int* maxFrameLag) const override { |
| 163 if (!this->gl->getMaxGpuFrameLag(maxFrameLag)) { | 163 if (!this->gl->getMaxGpuFrameLag(maxFrameLag)) { |
| 164 // Frame lag is unknown. | 164 // Frame lag is unknown. |
| 165 *maxFrameLag = FLAGS_gpuFrameLag; | 165 *maxFrameLag = FLAGS_gpuFrameLag; |
| 166 } | 166 } |
| 167 return true; | 167 return true; |
| 168 } | 168 } |
| 169 bool init(SkImageInfo info, Benchmark* bench) override { | 169 bool init(SkImageInfo info, Benchmark* bench) override { |
| 170 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDistanceFi
eldFonts_Flag : 0; | 170 uint32_t flags = this->config.useDFText ? SkSurfaceProps::kUseDeviceInde
pendentFonts_Flag : |
| 171 0; |
| 171 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 172 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
| 172 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType), | 173 this->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(this->con
fig.ctxType), |
| 173 SkSurface::kNo_Budgeted
, info, | 174 SkSurface::kNo_Budgeted
, info, |
| 174 this->config.samples, &
props)); | 175 this->config.samples, &
props)); |
| 175 this->gl = gGrFactory->getGLContext(this->config.ctxType); | 176 this->gl = gGrFactory->getGLContext(this->config.ctxType); |
| 176 if (!this->surface.get()) { | 177 if (!this->surface.get()) { |
| 177 return false; | 178 return false; |
| 178 } | 179 } |
| 179 if (!this->gl->fenceSyncSupport()) { | 180 if (!this->gl->fenceSyncSupport()) { |
| 180 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " | 181 SkDebugf("WARNING: GL context for config \"%s\" does not support fen
ce sync. " |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1159 | 1160 |
| 1160 return 0; | 1161 return 0; |
| 1161 } | 1162 } |
| 1162 | 1163 |
| 1163 #if !defined SK_BUILD_FOR_IOS | 1164 #if !defined SK_BUILD_FOR_IOS |
| 1164 int main(int argc, char** argv) { | 1165 int main(int argc, char** argv) { |
| 1165 SkCommandLineFlags::Parse(argc, argv); | 1166 SkCommandLineFlags::Parse(argc, argv); |
| 1166 return nanobench_main(); | 1167 return nanobench_main(); |
| 1167 } | 1168 } |
| 1168 #endif | 1169 #endif |
| OLD | NEW |