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

Side by Side Diff: bench/nanobench.h

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 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 | « bench/SKPBench.cpp ('k') | bench/nanobench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #ifndef nanobench_DEFINED 8 #ifndef nanobench_DEFINED
9 #define nanobench_DEFINED 9 #define nanobench_DEFINED
10 10
(...skipping 26 matching lines...) Expand all
37 int bogusIntOption; 37 int bogusIntOption;
38 bool bogusBool; 38 bool bogusBool;
39 #endif 39 #endif
40 }; 40 };
41 41
42 struct Target { 42 struct Target {
43 explicit Target(const Config& c) : config(c) { } 43 explicit Target(const Config& c) : config(c) { }
44 virtual ~Target() { } 44 virtual ~Target() { }
45 45
46 const Config config; 46 const Config config;
47 SkAutoTDelete<SkSurface> surface; 47 sk_sp<SkSurface> surface;
48 48
49 /** Called once per target, immediately before any timing or drawing. */ 49 /** Called once per target, immediately before any timing or drawing. */
50 virtual void setup() { } 50 virtual void setup() { }
51 51
52 /** Called *after* the clock timer is started, before the benchmark 52 /** Called *after* the clock timer is started, before the benchmark
53 is drawn. Most back ends just return the canvas passed in, 53 is drawn. Most back ends just return the canvas passed in,
54 but some may replace it. */ 54 but some may replace it. */
55 virtual SkCanvas* beginTiming(SkCanvas* canvas) { return canvas; } 55 virtual SkCanvas* beginTiming(SkCanvas* canvas) { return canvas; }
56 56
57 /** Called *after* a benchmark is drawn, but before the clock timer 57 /** Called *after* a benchmark is drawn, but before the clock timer
(...skipping 23 matching lines...) Expand all
81 81
82 SkCanvas* getCanvas() const { 82 SkCanvas* getCanvas() const {
83 if (!surface.get()) { 83 if (!surface.get()) {
84 return nullptr; 84 return nullptr;
85 } 85 }
86 return surface->getCanvas(); 86 return surface->getCanvas();
87 } 87 }
88 }; 88 };
89 89
90 #endif // nanobench_DEFINED 90 #endif // nanobench_DEFINED
OLDNEW
« no previous file with comments | « bench/SKPBench.cpp ('k') | bench/nanobench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698