| Index: ui/gfx/color_transform.cc
|
| diff --git a/ui/gfx/color_transform.cc b/ui/gfx/color_transform.cc
|
| index c87652b0c7f81669df4c4f6c05079196b881394c..f0805dd7bf8d666aaf097ab8ede68d5c06c8ba3c 100644
|
| --- a/ui/gfx/color_transform.cc
|
| +++ b/ui/gfx/color_transform.cc
|
| @@ -788,9 +788,20 @@ class QCMSColorTransform : public ColorTransformStep {
|
|
|
| ScopedQcmsProfile ColorTransformInternal::GetQCMSProfileIfNecessary(
|
| const ColorSpace& color_space) {
|
| - ICCProfile icc_profile;
|
| - if (!ICCProfile::FromId(color_space.icc_profile_id_, true, &icc_profile))
|
| + if (color_space.primaries_ != ColorSpace::PrimaryID::ICC_BASED &&
|
| + color_space.transfer_ != ColorSpace::TransferID::ICC_BASED) {
|
| return nullptr;
|
| + }
|
| + // TODO(ccameron): Use SkColorSpaceXform here to avoid looking up the
|
| + // ICCProfile.
|
| + ICCProfile icc_profile;
|
| + if (!ICCProfile::FromId(color_space.icc_profile_id_, &icc_profile)) {
|
| + // We needed the original ICC profile to construct this transform, but it
|
| + // has been flushed from our cache. Fall back to using the ICC profile's
|
| + // inaccurate, so spam the console.
|
| + LOG(ERROR) << "Failed to retrieve original ICC profile, using sRGB";
|
| + return ScopedQcmsProfile(qcms_profile_sRGB());
|
| + }
|
| return ScopedQcmsProfile(qcms_profile_from_memory(
|
| icc_profile.GetData().data(), icc_profile.GetData().size()));
|
| }
|
|
|