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 "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkBitmap.h" | 9 #include "SkBitmap.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 for (int i = 1; i < n; i++) { | 146 for (int i = 1; i < n; i++) { |
147 rad += drad; | 147 rad += drad; |
148 SkScalar cosV, sinV = SkScalarSinCos(rad, &cosV); | 148 SkScalar cosV, sinV = SkScalarSinCos(rad, &cosV); |
149 path->lineTo(cosV, sinV); | 149 path->lineTo(cosV, sinV); |
150 } | 150 } |
151 path->close(); | 151 path->close(); |
152 } | 152 } |
153 | 153 |
154 static void make_poly(SkPath* path) { | 154 static void make_poly(SkPath* path) { |
155 make_unit_star(path, 9); | 155 make_unit_star(path, 9); |
156 SkMatrix matrix; | 156 const SkMatrix matrix = SkMatrix::MakeScale(SkIntToScalar(100), SkIntToScala
r(100)); |
157 matrix.setScale(SkIntToScalar(100), SkIntToScalar(100)); | |
158 path->transform(matrix); | 157 path->transform(matrix); |
159 } | 158 } |
160 | 159 |
161 static void make_quad(SkPath* path) { | 160 static void make_quad(SkPath* path) { |
162 SkScalar x0 = SkIntToScalar(10); | 161 SkScalar x0 = SkIntToScalar(10); |
163 SkScalar y0 = SkIntToScalar(10); | 162 SkScalar y0 = SkIntToScalar(10); |
164 path->moveTo(x0, y0); | 163 path->moveTo(x0, y0); |
165 path->quadTo(x0, y0 + 400 * SK_Scalar1, | 164 path->quadTo(x0, y0 + 400 * SK_Scalar1, |
166 x0 + 600 * SK_Scalar1, y0 + 400 * SK_Scalar1); | 165 x0 + 600 * SK_Scalar1, y0 + 400 * SK_Scalar1); |
167 } | 166 } |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 // hori_2 is just too slow to enable at the moment | 479 // hori_2 is just too slow to enable at the moment |
481 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); ) | 480 DEF_BENCH( return new GiantDashBench(GiantDashBench::kHori_LineType, 2); ) |
482 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); ) | 481 DEF_BENCH( return new GiantDashBench(GiantDashBench::kVert_LineType, 2); ) |
483 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); ) | 482 DEF_BENCH( return new GiantDashBench(GiantDashBench::kDiag_LineType, 2); ) |
484 | 483 |
485 DEF_BENCH( return new DashGridBench(1, 1, true); ) | 484 DEF_BENCH( return new DashGridBench(1, 1, true); ) |
486 DEF_BENCH( return new DashGridBench(1, 1, false); ) | 485 DEF_BENCH( return new DashGridBench(1, 1, false); ) |
487 DEF_BENCH( return new DashGridBench(3, 1, true); ) | 486 DEF_BENCH( return new DashGridBench(3, 1, true); ) |
488 DEF_BENCH( return new DashGridBench(3, 1, false); ) | 487 DEF_BENCH( return new DashGridBench(3, 1, false); ) |
489 #endif | 488 #endif |
OLD | NEW |