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

Side by Side Diff: bench/DisplacementBench.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/DeferredSurfaceCopyBench.cpp ('k') | bench/ETCBitmapBench.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 #include "SkBenchmark.h" 7 #include "Benchmark.h"
8 #include "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
11 #include "SkDisplacementMapEffect.h" 11 #include "SkDisplacementMapEffect.h"
12 12
13 #define FILTER_WIDTH_SMALL 32 13 #define FILTER_WIDTH_SMALL 32
14 #define FILTER_HEIGHT_SMALL 32 14 #define FILTER_HEIGHT_SMALL 32
15 #define FILTER_WIDTH_LARGE 256 15 #define FILTER_WIDTH_LARGE 256
16 #define FILTER_HEIGHT_LARGE 256 16 #define FILTER_HEIGHT_LARGE 256
17 17
18 class DisplacementBaseBench : public SkBenchmark { 18 class DisplacementBaseBench : public Benchmark {
19 public: 19 public:
20 DisplacementBaseBench(bool small) : 20 DisplacementBaseBench(bool small) :
21 fInitialized(false), fIsSmall(small) { 21 fInitialized(false), fIsSmall(small) {
22 } 22 }
23 23
24 protected: 24 protected:
25 virtual void onPreDraw() SK_OVERRIDE { 25 virtual void onPreDraw() SK_OVERRIDE {
26 if (!fInitialized) { 26 if (!fInitialized) {
27 this->makeBitmap(); 27 this->makeBitmap();
28 this->makeCheckerboard(); 28 this->makeCheckerboard();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 canvas->drawBitmap(fBitmap, SkIntToScalar(x), SkIntToScalar(y), &paint); 75 canvas->drawBitmap(fBitmap, SkIntToScalar(x), SkIntToScalar(y), &paint);
76 canvas->restore(); 76 canvas->restore();
77 } 77 }
78 78
79 inline bool isSmall() const { return fIsSmall; } 79 inline bool isSmall() const { return fIsSmall; }
80 80
81 SkBitmap fBitmap, fCheckerboard; 81 SkBitmap fBitmap, fCheckerboard;
82 private: 82 private:
83 bool fInitialized; 83 bool fInitialized;
84 bool fIsSmall; 84 bool fIsSmall;
85 typedef SkBenchmark INHERITED; 85 typedef Benchmark INHERITED;
86 }; 86 };
87 87
88 class DisplacementZeroBench : public DisplacementBaseBench { 88 class DisplacementZeroBench : public DisplacementBaseBench {
89 public: 89 public:
90 DisplacementZeroBench(bool small) : INHERITED(small) { 90 DisplacementZeroBench(bool small) : INHERITED(small) {
91 } 91 }
92 92
93 protected: 93 protected:
94 virtual const char* onGetName() SK_OVERRIDE { 94 virtual const char* onGetName() SK_OVERRIDE {
95 return this->isSmall() ? "displacement_zero_small" : "displacement_zero_ large"; 95 return this->isSmall() ? "displacement_zero_small" : "displacement_zero_ large";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 }; 165 };
166 166
167 /////////////////////////////////////////////////////////////////////////////// 167 ///////////////////////////////////////////////////////////////////////////////
168 168
169 DEF_BENCH( return new DisplacementZeroBench(true); ) 169 DEF_BENCH( return new DisplacementZeroBench(true); )
170 DEF_BENCH( return new DisplacementAlphaBench(true); ) 170 DEF_BENCH( return new DisplacementAlphaBench(true); )
171 DEF_BENCH( return new DisplacementFullBench(true); ) 171 DEF_BENCH( return new DisplacementFullBench(true); )
172 DEF_BENCH( return new DisplacementZeroBench(false); ) 172 DEF_BENCH( return new DisplacementZeroBench(false); )
173 DEF_BENCH( return new DisplacementAlphaBench(false); ) 173 DEF_BENCH( return new DisplacementAlphaBench(false); )
174 DEF_BENCH( return new DisplacementFullBench(false); ) 174 DEF_BENCH( return new DisplacementFullBench(false); )
OLDNEW
« no previous file with comments | « bench/DeferredSurfaceCopyBench.cpp ('k') | bench/ETCBitmapBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698