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