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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 notImplemented(); 151 notImplemented();
152 #endif 152 #endif
153 } 153 }
154 154
155 void ImageFrame::setStatus(FrameStatus status) 155 void ImageFrame::setStatus(FrameStatus status)
156 { 156 {
157 m_status = status; 157 m_status = status;
158 if (m_status == FrameComplete) { 158 if (m_status == FrameComplete) {
159 m_bitmap.setDataComplete(); // Tell the bitmap it's done. 159 m_bitmap.setDataComplete(); // Tell the bitmap it's done.
160 #if PLATFORM(CHROMIUM) && OS(DARWIN) 160 #if PLATFORM(CHROMIUM) && OS(DARWIN)
161 if (m_colorProfile.isEmpty()) 161 // resolveColorSpace() and callees assume that the alpha channel is
162 // premultiplied, so don't apply the color profile if it isn't.
163 if (m_colorProfile.isEmpty() || !m_premultiplyAlpha)
162 return; 164 return;
163 RetainPtr<CGColorSpaceRef> cgColorSpace(AdoptCF, createColorSpace(m_colo rProfile)); 165 RetainPtr<CGColorSpaceRef> cgColorSpace(AdoptCF, createColorSpace(m_colo rProfile));
164 resolveColorSpace(m_bitmap.bitmap(), cgColorSpace.get()); 166 resolveColorSpace(m_bitmap.bitmap(), cgColorSpace.get());
165 #endif 167 #endif
166 } 168 }
167 } 169 }
168 170
169 int ImageFrame::width() const 171 int ImageFrame::width() const
170 { 172 {
171 return m_bitmap.bitmap().width(); 173 return m_bitmap.bitmap().width();
172 } 174 }
173 175
174 int ImageFrame::height() const 176 int ImageFrame::height() const
175 { 177 {
176 return m_bitmap.bitmap().height(); 178 return m_bitmap.bitmap().height();
177 } 179 }
178 180
179 } // namespace WebCore 181 } // namespace WebCore
OLDNEW
« 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