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 "SkSRGB.h" | 8 #include "SkSRGB.h" |
9 #include "SkTypes.h" | 9 #include "SkTypes.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // Should be monotonic between 0 and 1. | 26 // Should be monotonic between 0 and 1. |
27 uint8_t prev = 0; | 27 uint8_t prev = 0; |
28 for (float f = FLT_MIN; f <= 1.0f; ) { // We don't bother checking denorm v
alues. | 28 for (float f = FLT_MIN; f <= 1.0f; ) { // We don't bother checking denorm v
alues. |
29 uint8_t srgb = linear_to_srgb(f); | 29 uint8_t srgb = linear_to_srgb(f); |
30 | 30 |
31 REPORTER_ASSERT(r, srgb >= prev); | 31 REPORTER_ASSERT(r, srgb >= prev); |
32 prev = srgb; | 32 prev = srgb; |
33 | 33 |
34 union { float flt; uint32_t bits; } pun = { f }; | 34 union { float flt; uint32_t bits; } pun = { f }; |
35 pun.bits++; | 35 pun.bits++; |
| 36 SkDEBUGCODE(pun.bits += 127); |
36 f = pun.flt; | 37 f = pun.flt; |
37 } | 38 } |
38 } | 39 } |
OLD | NEW |