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 #if SK_SUPPORT_GPU | 9 #if SK_SUPPORT_GPU |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 kRGBA = kRGBA_GrColorComponentFlags | 57 kRGBA = kRGBA_GrColorComponentFlags |
58 }; | 58 }; |
59 | 59 |
60 // Note: below, SkColors are non-premultiplied, where as GrColors are premul
tiplied. | 60 // Note: below, SkColors are non-premultiplied, where as GrColors are premul
tiplied. |
61 | 61 |
62 const SkColor c1 = SkColorSetARGB(200, 200, 200, 200); | 62 const SkColor c1 = SkColorSetARGB(200, 200, 200, 200); |
63 const SkColor c2 = SkColorSetARGB(60, 60, 60, 60); | 63 const SkColor c2 = SkColorSetARGB(60, 60, 60, 60); |
64 const GrColor gr_c1 = SkColor2GrColor(c1); | 64 const GrColor gr_c1 = SkColor2GrColor(c1); |
65 const GrColor gr_c2 = SkColor2GrColor(c2); | 65 const GrColor gr_c2 = SkColor2GrColor(c2); |
66 | 66 |
67 const GrColor gr_black = GrColorPackRGBA(0, 0, 0, 0); | 67 const GrColor gr_black = GrColorPackA4(0); |
68 const GrColor gr_white = GrColorPackRGBA(255, 255, 255, 255); | 68 const GrColor gr_white = GrColorPackA4(255); |
69 const GrColor gr_whiteTrans = GrColorPackRGBA(128, 128, 128, 128); | 69 const GrColor gr_whiteTrans = GrColorPackA4(128); |
70 | 70 |
71 GetConstantComponentTestCase filterTests[] = { | 71 GetConstantComponentTestCase filterTests[] = { |
72 // A color filtered with Clear produces black. | 72 // A color filtered with Clear produces black. |
73 { kRGBA, gr_white, SK_ColorBLACK, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 73 { kRGBA, gr_white, SK_ColorBLACK, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
74 { kRGBA, gr_c1, SK_ColorWHITE, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 74 { kRGBA, gr_c1, SK_ColorWHITE, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
75 { kR, gr_white, c1, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, | 75 { kR, gr_white, c1, SkXfermode::kClear_Mode, kRGBA, gr_bla
ck }, |
76 | 76 |
77 // A color filtered with a color in mode Src, produces the filter color. | 77 // A color filtered with a color in mode Src, produces the filter color. |
78 { kRGBA, gr_c2, c1, SkXfermode::kSrc_Mode, kRGBA, gr_c1 }, | 78 { kRGBA, gr_c2, c1, SkXfermode::kSrc_Mode, kRGBA, gr_c1 }, |
79 { kA, gr_c1, c1, SkXfermode::kSrc_Mode, kRGBA, gr_c1 }, | 79 { kA, gr_c1, c1, SkXfermode::kSrc_Mode, kRGBA, gr_c1 }, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 GrContext* grContext = factory->get(glType); | 117 GrContext* grContext = factory->get(glType); |
118 if (NULL == grContext) { | 118 if (NULL == grContext) { |
119 continue; | 119 continue; |
120 } | 120 } |
121 | 121 |
122 test_getConstantColorComponents(reporter, grContext); | 122 test_getConstantColorComponents(reporter, grContext); |
123 } | 123 } |
124 } | 124 } |
125 | 125 |
126 #endif | 126 #endif |
OLD | NEW |