OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "gm.h" | 8 #include "gm.h" |
9 | 9 |
10 #include "SkSurface.h" | 10 #include "SkSurface.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 0.1009296f, 0.7249378f, 0.0517813f, // * G | 110 0.1009296f, 0.7249378f, 0.0517813f, // * G |
111 0.1471858f, 0.0168748f, 0.7734287f, // * B | 111 0.1471858f, 0.0168748f, 0.7734287f, // * B |
112 }; | 112 }; |
113 | 113 |
114 SkMatrix44 wideGamutRGB_toXYZD50(SkMatrix44::kUninitialized_Constructor); | 114 SkMatrix44 wideGamutRGB_toXYZD50(SkMatrix44::kUninitialized_Constructor); |
115 wideGamutRGB_toXYZD50.set3x3RowMajorf(gWideGamutRGB_toXYZD50); | 115 wideGamutRGB_toXYZD50.set3x3RowMajorf(gWideGamutRGB_toXYZD50); |
116 | 116 |
117 // Use the original canvas' color type, but account for gamma requirements | 117 // Use the original canvas' color type, but account for gamma requirements |
118 SkImageInfo origInfo = canvas->imageInfo(); | 118 SkImageInfo origInfo = canvas->imageInfo(); |
119 auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 119 auto srgbCS = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
120 auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_GammaNamed, wideGamut
RGB_toXYZD50); | 120 auto wideCS = SkColorSpace::NewRGB(SkColorSpace::kSRGB_RenderTargetGamma, |
| 121 wideGamutRGB_toXYZD50); |
121 switch (origInfo.colorType()) { | 122 switch (origInfo.colorType()) { |
122 case kRGBA_8888_SkColorType: | 123 case kRGBA_8888_SkColorType: |
123 case kBGRA_8888_SkColorType: | 124 case kBGRA_8888_SkColorType: |
124 break; | 125 break; |
125 case kRGBA_F16_SkColorType: | 126 case kRGBA_F16_SkColorType: |
126 srgbCS = srgbCS->makeLinearGamma(); | 127 srgbCS = srgbCS->makeLinearGamma(); |
127 wideCS = wideCS->makeLinearGamma(); | 128 wideCS = wideCS->makeLinearGamma(); |
128 break; | 129 break; |
129 default: | 130 default: |
130 return; | 131 return; |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 renderers.push_back(new GradientCellRenderer(SK_ColorRED, SK_ColorGREEN)); | 201 renderers.push_back(new GradientCellRenderer(SK_ColorRED, SK_ColorGREEN)); |
201 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorBLACK)); | 202 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorBLACK)); |
202 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorWHITE)); | 203 renderers.push_back(new GradientCellRenderer(SK_ColorGREEN, SK_ColorWHITE)); |
203 | 204 |
204 // Vertex colors | 205 // Vertex colors |
205 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorRED)); | 206 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorRED)); |
206 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorGREEN)); | 207 renderers.push_back(new VerticesCellRenderer(SK_ColorRED, SK_ColorGREEN)); |
207 | 208 |
208 draw_gamut_grid(canvas, renderers); | 209 draw_gamut_grid(canvas, renderers); |
209 } | 210 } |
OLD | NEW |