OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 | 8 |
9 #include "SkPathUtils.h" | 9 #include "SkPathUtils.h" |
10 | 10 |
11 #include "SkBitmap.h" | 11 #include "SkBitmap.h" |
12 #include "SkCanvas.h" | 12 #include "SkCanvas.h" |
13 #include "SkRandom.h" | 13 #include "SkRandom.h" |
14 #include "SkTime.h" | 14 #include "SkTime.h" |
15 #include "Test.h" | 15 #include "Test.h" |
16 | 16 |
17 const int kNumIt = 100; | 17 const int kNumIt = 100; |
18 | 18 |
19 static void fill_random_bits(int chars, char* bits){ | 19 static void fill_random_bits(int chars, char* bits){ |
20 SkMWCRandom rand(SkTime::GetMSecs()); | 20 SkRandom rand(SkTime::GetMSecs()); |
21 | 21 |
22 for (int i = 0; i < chars; ++i){ | 22 for (int i = 0; i < chars; ++i){ |
23 bits[i] = rand.nextU(); | 23 bits[i] = rand.nextU(); |
24 } | 24 } |
25 } | 25 } |
26 | 26 |
27 static int get_bit(const char* buffer, int x) { | 27 static int get_bit(const char* buffer, int x) { |
28 int byte = x >> 3; | 28 int byte = x >> 3; |
29 int bit = x & 7; | 29 int bit = x & 7; |
30 | 30 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 binary_to_skbitmap(binBmp, &bmpTruth, w[i], h, rowBytes); | 150 binary_to_skbitmap(binBmp, &bmpTruth, w[i], h, rowBytes); |
151 | 151 |
152 test_path(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); | 152 test_path(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); |
153 test_region(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); | 153 test_region(reporter, &bmpTruth, binBmp, w[i], h, rowBytes); |
154 } | 154 } |
155 } | 155 } |
156 } | 156 } |
157 | 157 |
158 #include "TestClassDef.h" | 158 #include "TestClassDef.h" |
159 DEFINE_TESTCLASS("PathUtils", PathUtils, TestPathUtils) | 159 DEFINE_TESTCLASS("PathUtils", PathUtils, TestPathUtils) |
OLD | NEW |