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 "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 SkAutoTUnref<SkPathEffect> fPathEffect; | 256 SkAutoTUnref<SkPathEffect> fPathEffect; |
257 | 257 |
258 public: | 258 public: |
259 DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA) | 259 DrawPointsDashingBench(int dashLength, int strokeWidth, bool doAA) |
260 { | 260 { |
261 fName.printf("drawpointsdash_%d_%d%s", dashLength, strokeWidth, doAA ? "
_aa" : "_bw"); | 261 fName.printf("drawpointsdash_%d_%d%s", dashLength, strokeWidth, doAA ? "
_aa" : "_bw"); |
262 fStrokeWidth = strokeWidth; | 262 fStrokeWidth = strokeWidth; |
263 fDoAA = doAA; | 263 fDoAA = doAA; |
264 | 264 |
265 SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength)
}; | 265 SkScalar vals[] = { SkIntToScalar(dashLength), SkIntToScalar(dashLength)
}; |
266 fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1, false)); | 266 fPathEffect.reset(SkDashPathEffect::Create(vals, 2, SK_Scalar1)); |
267 } | 267 } |
268 | 268 |
269 protected: | 269 protected: |
270 virtual const char* onGetName() SK_OVERRIDE { | 270 virtual const char* onGetName() SK_OVERRIDE { |
271 return fName.c_str(); | 271 return fName.c_str(); |
272 } | 272 } |
273 | 273 |
274 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { | 274 virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE { |
275 SkPaint p; | 275 SkPaint p; |
276 this->setupPaint(&p); | 276 this->setupPaint(&p); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 0); ) | 409 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 0); ) |
410 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 0); ) | 410 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 0); ) |
411 | 411 |
412 // pass 2 to explicitly avoid any 1-is-the-same-as-hairline special casing | 412 // pass 2 to explicitly avoid any 1-is-the-same-as-hairline special casing |
413 | 413 |
414 // hori_2 is just too slow to enable at the moment | 414 // hori_2 is just too slow to enable at the moment |
415 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); ) | 415 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); ) |
416 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); ) | 416 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); ) |
417 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); ) | 417 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); ) |
418 #endif | 418 #endif |
OLD | NEW |