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

Side by Side Diff: bench/nanobench.cpp

Issue 848903004: Require budget decision when creating a RenderTarget SkSurface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make compatible with chrome Created 5 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 | dm/DMGpuSupport.h » ('j') | gm/xfermodes3.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | dm/DMGpuSupport.h » ('j') | gm/xfermodes3.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698