OLD | NEW |
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 Loading... |
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 Loading... |
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 ); ) |
OLD | NEW |