OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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" | |
9 #include "SkColorPriv.h" | 8 #include "SkColorPriv.h" |
10 #include "SkXfermode.h" | 9 #include "SkXfermode.h" |
| 10 #include "Test.h" |
11 | 11 |
12 // our std SkAlpha255To256 | 12 // our std SkAlpha255To256 |
13 static int test_srcover0(unsigned dst, unsigned alpha) { | 13 static int test_srcover0(unsigned dst, unsigned alpha) { |
14 return alpha + SkAlphaMul(dst, SkAlpha255To256(255 - alpha)); | 14 return alpha + SkAlphaMul(dst, SkAlpha255To256(255 - alpha)); |
15 } | 15 } |
16 | 16 |
17 // faster hack +1 | 17 // faster hack +1 |
18 static int test_srcover1(unsigned dst, unsigned alpha) { | 18 static int test_srcover1(unsigned dst, unsigned alpha) { |
19 return alpha + SkAlphaMul(dst, 256 - alpha); | 19 return alpha + SkAlphaMul(dst, 256 - alpha); |
20 } | 20 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 #if 0 | 67 #if 0 |
68 // this shows where r1 (faster) differs from r2 (more exact) | 68 // this shows where r1 (faster) differs from r2 (more exact) |
69 if (r1 != r2) { | 69 if (r1 != r2) { |
70 SkDebugf("--- dst=%d i=%d r1=%d r2=%d exact=%g\n", | 70 SkDebugf("--- dst=%d i=%d r1=%d r2=%d exact=%g\n", |
71 dst, i, r1, r2, i + dst - dst*i/255.0f); | 71 dst, i, r1, r2, i + dst - dst*i/255.0f); |
72 } | 72 } |
73 #endif | 73 #endif |
74 } | 74 } |
75 } | 75 } |
76 } | 76 } |
OLD | NEW |