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

Unified Diff: Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp

Issue 9187038: Merge 104732 - [chromium] Color profiles are incorrect for images without premultiplied alpha (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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 | « LayoutTests/fast/canvas/webgl/texture-color-profile-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp
===================================================================
--- Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp (revision 104767)
+++ Source/WebCore/platform/image-decoders/skia/ImageDecoderSkia.cpp (working copy)
@@ -158,7 +158,9 @@
if (m_status == FrameComplete) {
m_bitmap.setDataComplete(); // Tell the bitmap it's done.
#if PLATFORM(CHROMIUM) && OS(DARWIN)
- if (m_colorProfile.isEmpty())
+ // resolveColorSpace() and callees assume that the alpha channel is
+ // premultiplied, so don't apply the color profile if it isn't.
+ if (m_colorProfile.isEmpty() || !m_premultiplyAlpha)
return;
RetainPtr<CGColorSpaceRef> cgColorSpace(AdoptCF, createColorSpace(m_colorProfile));
resolveColorSpace(m_bitmap.bitmap(), cgColorSpace.get());
« no previous file with comments | « LayoutTests/fast/canvas/webgl/texture-color-profile-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698