Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp

Issue 2359643002: color: Make images without embedded profiles sRGB by default (Closed)
Patch Set: Use DCHECK Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
index 6a4db8fa2d711b56af64eac34f940d4fd870781b..a2557d32a1be7f1a5346eb73c22afc603ee544f5 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageFrame.cpp
@@ -102,8 +102,13 @@ bool ImageFrame::setSizeAndColorProfile(int newWidth, int newHeight, const ICCPr
ASSERT(!width() && !height());
sk_sp<SkColorSpace> colorSpace;
- if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled() && !newIccProfile.isEmpty())
- colorSpace = SkColorSpace::NewICC(newIccProfile.data(), newIccProfile.size());
+ if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled()) {
+ if (newIccProfile.isEmpty())
+ colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
+ else
+ colorSpace = SkColorSpace::NewICC(newIccProfile.data(), newIccProfile.size());
+ DCHECK(colorSpace);
+ }
m_bitmap.setInfo(SkImageInfo::MakeN32(newWidth, newHeight,
m_premultiplyAlpha ? kPremul_SkAlphaType : kUnpremul_SkAlphaType, colorSpace));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698