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

Side by Side Diff: bench/RegionContainBench.cpp

Issue 347823004: Remove Sk prefix from some bench classes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkGMBench -> GMBench Created 6 years, 6 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/RegionBench.cpp ('k') | bench/RepeatTileBench.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 2013 Google Inc. 2 * Copyright 2013 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 "SkBenchmark.h" 8 #include "Benchmark.h"
9 #include "SkRandom.h" 9 #include "SkRandom.h"
10 #include "SkRegion.h" 10 #include "SkRegion.h"
11 #include "SkString.h" 11 #include "SkString.h"
12 12
13 static bool sect_proc(SkRegion& a, SkRegion& b) { 13 static bool sect_proc(SkRegion& a, SkRegion& b) {
14 SkRegion result; 14 SkRegion result;
15 return result.op(a, b, SkRegion::kIntersect_Op); 15 return result.op(a, b, SkRegion::kIntersect_Op);
16 } 16 }
17 17
18 class RegionContainBench : public SkBenchmark { 18 class RegionContainBench : public Benchmark {
19 public: 19 public:
20 typedef bool (*Proc)(SkRegion& a, SkRegion& b); 20 typedef bool (*Proc)(SkRegion& a, SkRegion& b);
21 SkRegion fA, fB; 21 SkRegion fA, fB;
22 Proc fProc; 22 Proc fProc;
23 SkString fName; 23 SkString fName;
24 24
25 enum { 25 enum {
26 W = 200, 26 W = 200,
27 H = 200, 27 H = 200,
28 COUNT = 10, 28 COUNT = 10,
(...skipping 25 matching lines...) Expand all
54 54
55 virtual void onDraw(const int loops, SkCanvas*) { 55 virtual void onDraw(const int loops, SkCanvas*) {
56 Proc proc = fProc; 56 Proc proc = fProc;
57 57
58 for (int i = 0; i < loops; ++i) { 58 for (int i = 0; i < loops; ++i) {
59 proc(fA, fB); 59 proc(fA, fB);
60 } 60 }
61 } 61 }
62 62
63 private: 63 private:
64 typedef SkBenchmark INHERITED; 64 typedef Benchmark INHERITED;
65 }; 65 };
66 66
67 DEF_BENCH( return SkNEW_ARGS(RegionContainBench, (sect_proc, "sect")); ) 67 DEF_BENCH( return SkNEW_ARGS(RegionContainBench, (sect_proc, "sect")); )
OLDNEW
« no previous file with comments | « bench/RegionBench.cpp ('k') | bench/RepeatTileBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698