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

Side by Side Diff: bench/RepeatTileBench.cpp

Issue 99893003: Simplify benchmark internal API. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « bench/RegionContainBench.cpp ('k') | bench/ScalarBench.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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBenchmark.h" 8 #include "SkBenchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 fBitmap = tmp; 126 fBitmap = tmp;
127 } 127 }
128 128
129 SkShader* s = SkShader::CreateBitmapShader(fBitmap, 129 SkShader* s = SkShader::CreateBitmapShader(fBitmap,
130 SkShader::kRepeat_TileMode, 130 SkShader::kRepeat_TileMode,
131 SkShader::kRepeat_TileMode); 131 SkShader::kRepeat_TileMode);
132 fPaint.setShader(s)->unref(); 132 fPaint.setShader(s)->unref();
133 } 133 }
134 134
135 135
136 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 136 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
137 SkPaint paint(fPaint); 137 SkPaint paint(fPaint);
138 this->setupPaint(&paint); 138 this->setupPaint(&paint);
139 139
140 for (int i = 0; i < this->getLoops(); i++) { 140 for (int i = 0; i < loops; i++) {
141 canvas->drawPaint(paint); 141 canvas->drawPaint(paint);
142 } 142 }
143 } 143 }
144 144
145 private: 145 private:
146 typedef SkBenchmark INHERITED; 146 typedef SkBenchmark INHERITED;
147 }; 147 };
148 148
149 DEF_BENCH(return new RepeatTileBench(SkBitmap::kARGB_8888_Config, true)) 149 DEF_BENCH(return new RepeatTileBench(SkBitmap::kARGB_8888_Config, true))
150 DEF_BENCH(return new RepeatTileBench(SkBitmap::kARGB_8888_Config, false)) 150 DEF_BENCH(return new RepeatTileBench(SkBitmap::kARGB_8888_Config, false))
151 DEF_BENCH(return new RepeatTileBench(SkBitmap::kRGB_565_Config)) 151 DEF_BENCH(return new RepeatTileBench(SkBitmap::kRGB_565_Config))
152 DEF_BENCH(return new RepeatTileBench(SkBitmap::kIndex8_Config)) 152 DEF_BENCH(return new RepeatTileBench(SkBitmap::kIndex8_Config))
OLDNEW
« no previous file with comments | « bench/RegionContainBench.cpp ('k') | bench/ScalarBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698