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

Side by Side Diff: bench/RectBench.cpp

Issue 85463005: remove SkFloatToScalar macro (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add flag to expose SkFloatToScalar to chromium 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/MorphologyBench.cpp ('k') | experimental/DrawingBoard/SampleDrawingClient.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 protected: 179 protected:
180 180
181 virtual const char* onGetName() { 181 virtual const char* onGetName() {
182 if (fRotate) { 182 if (fRotate) {
183 return "aarects_rotated"; 183 return "aarects_rotated";
184 } 184 }
185 return "aarects"; 185 return "aarects";
186 } 186 }
187 187
188 virtual void onDraw(SkCanvas* canvas) { 188 virtual void onDraw(SkCanvas* canvas) {
189 static const SkScalar kHalfRectSize = SkFloatToScalar(0.75f); 189 static const SkScalar kHalfRectSize = 0.75f;
190 190
191 SkPaint paint; 191 SkPaint paint;
192 this->setupPaint(&paint); 192 this->setupPaint(&paint);
193 paint.setAntiAlias(true); 193 paint.setAntiAlias(true);
194 paint.setColor(SK_ColorBLACK); 194 paint.setColor(SK_ColorBLACK);
195 SkRect r = { -kHalfRectSize, -kHalfRectSize, kHalfRectSize, kHalfRectSiz e }; 195 SkRect r = { -kHalfRectSize, -kHalfRectSize, kHalfRectSize, kHalfRectSiz e };
196 int rot = 0; 196 int rot = 0;
197 197
198 for (int i = 0; i < this->getLoops(); i++) { 198 for (int i = 0; i < this->getLoops(); i++) {
199 // Draw small aa rects in a grid across the screen 199 // Draw small aa rects in a grid across the screen
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 BlitMaskBench::kMaskBlack, "maskblack") 334 BlitMaskBench::kMaskBlack, "maskblack")
335 ); ) 335 ); )
336 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, 336 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
337 (SkCanvas::kPoints_PointMode, 337 (SkCanvas::kPoints_PointMode,
338 BlitMaskBench::kMaskColor, "maskcolor") 338 BlitMaskBench::kMaskColor, "maskcolor")
339 ); ) 339 ); )
340 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench, 340 DEF_BENCH( return SkNEW_ARGS(BlitMaskBench,
341 (SkCanvas::kPoints_PointMode, 341 (SkCanvas::kPoints_PointMode,
342 BlitMaskBench::KMaskShader, "maskshader") 342 BlitMaskBench::KMaskShader, "maskshader")
343 ); ) 343 ); )
OLDNEW
« no previous file with comments | « bench/MorphologyBench.cpp ('k') | experimental/DrawingBoard/SampleDrawingClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698