OLD | NEW |
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 Loading... |
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 |
OLD | NEW |