OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "Test.h" | 8 #include "Test.h" |
9 #include "SkAutoPixmapStorage.h" | |
10 #include "SkColor.h" | 9 #include "SkColor.h" |
11 #include "SkHalf.h" | 10 #include "SkHalf.h" |
12 #include "SkOpts.h" | 11 #include "SkOpts.h" |
13 #include "SkPixmap.h" | 12 #include "SkPixmap.h" |
14 #include "SkPM4f.h" | 13 #include "SkPM4f.h" |
15 #include "SkRandom.h" | 14 #include "SkRandom.h" |
16 | 15 |
17 static bool eq_within_half_float(float a, float b) { | 16 static bool eq_within_half_float(float a, float b) { |
18 const float kTolerance = 1.0f / (1 << (8 + 10)); | 17 const float kTolerance = 1.0f / (1 << (8 + 10)); |
19 | 18 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool ok = (h1 == h2 || h1 == h2-1); | 106 bool ok = (h1 == h2 || h1 == h2-1); |
108 REPORTER_ASSERT(r, ok); | 107 REPORTER_ASSERT(r, ok); |
109 if (!ok) { | 108 if (!ok) { |
110 SkDebugf("%08x (%d) -> %04x (%d), want %04x (%d)\n", | 109 SkDebugf("%08x (%d) -> %04x (%d), want %04x (%d)\n", |
111 bits, bits>>23, h1, h1>>10, h2, h2>>10); | 110 bits, bits>>23, h1, h1>>10, h2, h2>>10); |
112 break; | 111 break; |
113 } | 112 } |
114 } | 113 } |
115 } | 114 } |
116 } | 115 } |
OLD | NEW |