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 "Benchmark.h" | 10 #include "Benchmark.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 | 388 |
389 Target* target = new Target(config); | 389 Target* target = new Target(config); |
390 | 390 |
391 if (Benchmark::kRaster_Backend == config.backend) { | 391 if (Benchmark::kRaster_Backend == config.backend) { |
392 target->surface.reset(SkSurface::NewRaster(info)); | 392 target->surface.reset(SkSurface::NewRaster(info)); |
393 } | 393 } |
394 #if SK_SUPPORT_GPU | 394 #if SK_SUPPORT_GPU |
395 else if (Benchmark::kGPU_Backend == config.backend) { | 395 else if (Benchmark::kGPU_Backend == config.backend) { |
396 uint32_t flags = config.useDFText ? SkSurfaceProps::kUseDistanceFieldFon
ts_Flag : 0; | 396 uint32_t flags = config.useDFText ? SkSurfaceProps::kUseDistanceFieldFon
ts_Flag : 0; |
397 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); | 397 SkSurfaceProps props(flags, SkSurfaceProps::kLegacyFontHost_InitType); |
398 target->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(config.
ctxType), info, | 398 target->surface.reset(SkSurface::NewRenderTarget(gGrFactory->get(config.
ctxType), |
| 399 SkSurface::kNo_Budgeted
, info, |
399 config.samples, &props)
); | 400 config.samples, &props)
); |
400 target->gl = gGrFactory->getGLContext(config.ctxType); | 401 target->gl = gGrFactory->getGLContext(config.ctxType); |
401 } | 402 } |
402 #endif | 403 #endif |
403 | 404 |
404 if (Benchmark::kNonRendering_Backend != config.backend && !target->surface.g
et()) { | 405 if (Benchmark::kNonRendering_Backend != config.backend && !target->surface.g
et()) { |
405 delete target; | 406 delete target; |
406 return NULL; | 407 return NULL; |
407 } | 408 } |
408 return target; | 409 return target; |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
796 | 797 |
797 return 0; | 798 return 0; |
798 } | 799 } |
799 | 800 |
800 #if !defined SK_BUILD_FOR_IOS | 801 #if !defined SK_BUILD_FOR_IOS |
801 int main(int argc, char** argv) { | 802 int main(int argc, char** argv) { |
802 SkCommandLineFlags::Parse(argc, argv); | 803 SkCommandLineFlags::Parse(argc, argv); |
803 return nanobench_main(); | 804 return nanobench_main(); |
804 } | 805 } |
805 #endif | 806 #endif |
OLD | NEW |