Chromium Code Reviews| Index: ui/gfx/color_space.cc |
| diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc |
| index 18a25adba49131b5d0da035a4e57b2e6f8d78614..0e4914d341df2b15804e080de81e535045685060 100644 |
| --- a/ui/gfx/color_space.cc |
| +++ b/ui/gfx/color_space.cc |
| @@ -144,6 +144,15 @@ sk_sp<SkColorSpace> ColorSpace::ToSkColorSpace() const { |
| if (*this == gfx::ColorSpace()) |
| return nullptr; |
| + // Check for srgb and linear-srgb |
|
ccameron
2016/11/11 20:00:44
Thanks, sorry for leaving this part unimplemented.
|
| + if (primaries_ == PrimaryID::BT709 && matrix_ == MatrixID::RGB |
| + && range_ == RangeID::FULL) { |
| + if (transfer_ == TransferID::IEC61966_2_1) |
| + return SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); |
| + else if (transfer_ == TransferID::BT709) |
| + return SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named); |
| + } |
| + |
| // TODO(crbug.com/634102): Support more than just ICC profile based color |
| // spaces. The DCHECK here is to ensure that callers that expect a valid |
| // result are notified of this incomplete functionality. |