| Index: ui/gfx/icc_profile.cc
|
| diff --git a/ui/gfx/icc_profile.cc b/ui/gfx/icc_profile.cc
|
| index 118a071124a06c7c064c1f5f20bf596429affda3..88cf912c080aa40cd94a48bb078c4652fae762a1 100644
|
| --- a/ui/gfx/icc_profile.cc
|
| +++ b/ui/gfx/icc_profile.cc
|
| @@ -42,6 +42,9 @@ ICCProfile& ICCProfile::operator=(ICCProfile&& other) = default;
|
| ICCProfile& ICCProfile::operator=(const ICCProfile& other) = default;
|
| ICCProfile::~ICCProfile() = default;
|
|
|
| +// Turn off color correct rendering by default.
|
| +bool ICCProfile::color_correct_rendering_ = false;
|
| +
|
| bool ICCProfile::operator==(const ICCProfile& other) const {
|
| return valid_ == other.valid_ && data_ == other.data_;
|
| }
|
| @@ -79,6 +82,8 @@ ICCProfile ICCProfile::FromData(const char* data, size_t size) {
|
| #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(USE_X11)
|
| // static
|
| ICCProfile ICCProfile::FromBestMonitor() {
|
| + if (color_correct_rendering_)
|
| + return gfx::ICCProfile::FromColorSpace(gfx::ColorSpace::CreateSRGB());
|
| return ICCProfile();
|
| }
|
| #endif
|
| @@ -105,8 +110,11 @@ const std::vector<char>& ICCProfile::GetData() const {
|
| }
|
|
|
| ColorSpace ICCProfile::GetColorSpace() const {
|
| - if (!valid_)
|
| + if (!valid_) {
|
| + if (color_correct_rendering_)
|
| + return gfx::ColorSpace::CreateSRGB();
|
| return gfx::ColorSpace();
|
| + }
|
|
|
| ColorSpace color_space(ColorSpace::PrimaryID::CUSTOM,
|
| ColorSpace::TransferID::CUSTOM,
|
| @@ -174,4 +182,8 @@ bool ICCProfile::IsValidProfileLength(size_t length) {
|
| return length >= kMinProfileLength && length <= kMaxProfileLength;
|
| }
|
|
|
| +void ICCProfile::SetColorCorrectRendering(bool color_correct_rendering) {
|
| + color_correct_rendering_ = color_correct_rendering;
|
| +}
|
| +
|
| } // namespace gfx
|
|
|