OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "Benchmark.h" | 8 #include "Benchmark.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkFixed.h" | 10 #include "SkFixed.h" |
| 11 #include "SkMathPriv.h" |
11 #include "SkMatrix.h" | 12 #include "SkMatrix.h" |
12 #include "SkPaint.h" | 13 #include "SkPaint.h" |
13 #include "SkRandom.h" | 14 #include "SkRandom.h" |
14 #include "SkString.h" | 15 #include "SkString.h" |
15 | 16 |
16 static float sk_fsel(float pred, float result_ge, float result_lt) { | 17 static float sk_fsel(float pred, float result_ge, float result_lt) { |
17 return pred >= 0 ? result_ge : result_lt; | 18 return pred >= 0 ? result_ge : result_lt; |
18 } | 19 } |
19 | 20 |
20 static float fast_floor(float x) { | 21 static float fast_floor(float x) { |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 627 |
627 void onDraw(int loops, SkCanvas*) override { | 628 void onDraw(int loops, SkCanvas*) override { |
628 while (loops --> 0) { | 629 while (loops --> 0) { |
629 for (int i = 0; i < N; i++) { | 630 for (int i = 0; i < N; i++) { |
630 fInts[i] = SkFloatToIntFloor(fFloats[i]); | 631 fInts[i] = SkFloatToIntFloor(fFloats[i]); |
631 } | 632 } |
632 } | 633 } |
633 } | 634 } |
634 }; | 635 }; |
635 DEF_BENCH( return new FloatToIntBench; ) | 636 DEF_BENCH( return new FloatToIntBench; ) |
OLD | NEW |