OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "SkColorFilter.h" | 9 #include "SkColorFilter.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 kB = kB_GrColorComponentFlag, | 55 kB = kB_GrColorComponentFlag, |
56 kA = kA_GrColorComponentFlag, | 56 kA = kA_GrColorComponentFlag, |
57 kRGB = kRGB_GrColorComponentFlags, | 57 kRGB = kRGB_GrColorComponentFlags, |
58 kRGBA = kRGBA_GrColorComponentFlags | 58 kRGBA = kRGBA_GrColorComponentFlags |
59 }; | 59 }; |
60 | 60 |
61 // Note: below, SkColors are non-premultiplied, where as GrColors are premul
tiplied. | 61 // Note: below, SkColors are non-premultiplied, where as GrColors are premul
tiplied. |
62 | 62 |
63 const SkColor c1 = SkColorSetARGB(200, 200, 200, 200); | 63 const SkColor c1 = SkColorSetARGB(200, 200, 200, 200); |
64 const SkColor c2 = SkColorSetARGB(60, 60, 60, 60); | 64 const SkColor c2 = SkColorSetARGB(60, 60, 60, 60); |
65 const GrColor gr_c1 = SkColor2GrColor(c1); | 65 const GrColor gr_c1 = SkColorToPremulGrColor(c1); |
66 const GrColor gr_c2 = SkColor2GrColor(c2); | 66 const GrColor gr_c2 = SkColorToPremulGrColor(c2); |
67 | 67 |
68 const GrColor gr_black = GrColorPackA4(0); | 68 const GrColor gr_black = GrColorPackA4(0); |
69 const GrColor gr_white = GrColorPackA4(255); | 69 const GrColor gr_white = GrColorPackA4(255); |
70 const GrColor gr_whiteTrans = GrColorPackA4(128); | 70 const GrColor gr_whiteTrans = GrColorPackA4(128); |
71 | 71 |
72 GetConstantComponentTestCase filterTests[] = { | 72 GetConstantComponentTestCase filterTests[] = { |
73 // A color filtered with Clear produces black. | 73 // A color filtered with Clear produces black. |
74 { kRGBA, gr_white, SK_ColorBLACK, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 74 { kRGBA, gr_white, SK_ColorBLACK, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
75 { kRGBA, gr_c1, SK_ColorWHITE, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 75 { kRGBA, gr_c1, SK_ColorWHITE, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
76 { kR, gr_white, c1, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 76 { kR, gr_white, c1, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 GrContext* grContext = factory->get(glType); | 123 GrContext* grContext = factory->get(glType); |
124 if (nullptr == grContext) { | 124 if (nullptr == grContext) { |
125 continue; | 125 continue; |
126 } | 126 } |
127 | 127 |
128 test_getConstantColorComponents(reporter, grContext); | 128 test_getConstantColorComponents(reporter, grContext); |
129 } | 129 } |
130 } | 130 } |
131 | 131 |
132 #endif | 132 #endif |
OLD | NEW |