OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 | 9 |
10 #if SK_SUPPORT_GPU | 10 #if SK_SUPPORT_GPU |
11 | 11 |
12 #include "GrBlend.h" | 12 #include "GrBlend.h" |
13 #include "SkGr.h" | 13 #include "SkGr.h" |
| 14 #include "SkGrPriv.h" |
14 #include "SkRandom.h" | 15 #include "SkRandom.h" |
15 #include "SkXfermode.h" | 16 #include "SkXfermode.h" |
16 | 17 |
17 static GrColor make_baseline_color(GrColor src, GrColor dst, const SkXfermode* x
m) { | 18 static GrColor make_baseline_color(GrColor src, GrColor dst, const SkXfermode* x
m) { |
18 SkPMColor skSrc = GrColorToSkPMColor(src); | 19 SkPMColor skSrc = GrColorToSkPMColor(src); |
19 SkPMColor skDst = GrColorToSkPMColor(dst); | 20 SkPMColor skDst = GrColorToSkPMColor(dst); |
20 if (xm) { | 21 if (xm) { |
21 xm->xfer32(&skDst, &skSrc, 1, nullptr); | 22 xm->xfer32(&skDst, &skSrc, 1, nullptr); |
22 } else { | 23 } else { |
23 // null means src-over | 24 // null means src-over |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 kOne_GrBlendCoeff, kISA_GrBlendCoeff, | 94 kOne_GrBlendCoeff, kISA_GrBlendCoeff, |
94 0xFF808080, (kG_GrColorComponentFlag | kB_GrColorComponentFlag | kA_GrCo
lorComponentFlag), | 95 0xFF808080, (kG_GrColorComponentFlag | kB_GrColorComponentFlag | kA_GrCo
lorComponentFlag), |
95 0xFF606060, kRGBA_GrColorComponentFlags, | 96 0xFF606060, kRGBA_GrColorComponentFlags, |
96 &outColor, &outFlags); | 97 &outColor, &outFlags); |
97 REPORTER_ASSERT(reporter, | 98 REPORTER_ASSERT(reporter, |
98 (kG_GrColorComponentFlag | kB_GrColorComponentFlag | kA_GrCo
lorComponentFlag) == outFlags && | 99 (kG_GrColorComponentFlag | kB_GrColorComponentFlag | kA_GrCo
lorComponentFlag) == outFlags && |
99 (outColor & 0xFFFFFF00) == 0xFF808000); | 100 (outColor & 0xFFFFFF00) == 0xFF808000); |
100 } | 101 } |
101 | 102 |
102 #endif | 103 #endif |
OLD | NEW |