OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 m_haveReadProfile = true; | 186 m_haveReadProfile = true; |
187 } | 187 } |
188 | 188 |
189 ASSERT(width == size().width()); | 189 ASSERT(width == size().width()); |
190 ASSERT(decodedHeight <= size().height()); | 190 ASSERT(decodedHeight <= size().height()); |
191 | 191 |
192 for (int y = m_decodedHeight; y < decodedHeight; ++y) { | 192 for (int y = m_decodedHeight; y < decodedHeight; ++y) { |
193 uint8_t* row = reinterpret_cast<uint8_t*>(buffer.getAddr(0, y)); | 193 uint8_t* row = reinterpret_cast<uint8_t*>(buffer.getAddr(0, y)); |
194 if (qcms_transform* transform = colorTransform()) | 194 if (qcms_transform* transform = colorTransform()) |
195 qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGB
X); | 195 qcms_transform_data_type(transform, row, row, width, QCMS_OUTPUT_RGB
X); |
196 uint8_t* pixel = row; | 196 buffer.fillRowFromRGBASource(y, row); |
197 for (int x = 0; x < width; ++x, pixel += 4) | |
198 buffer.setRGBA(x, y, pixel[0], pixel[1], pixel[2], pixel[3]); | |
199 } | 197 } |
200 | 198 |
201 m_decodedHeight = decodedHeight; | 199 m_decodedHeight = decodedHeight; |
202 } | 200 } |
203 | 201 |
204 #endif // QCMS_WEBP_COLOR_CORRECTION | 202 #endif // QCMS_WEBP_COLOR_CORRECTION |
205 | 203 |
206 bool WEBPImageDecoder::decode(bool onlySize) | 204 bool WEBPImageDecoder::decode(bool onlySize) |
207 { | 205 { |
208 if (failed()) | 206 if (failed()) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile()) | 290 if ((m_formatFlags & ICCP_FLAG) && !ignoresGammaAndColorProfile()) |
293 applyColorProfile(dataBytes, dataSize, buffer); | 291 applyColorProfile(dataBytes, dataSize, buffer); |
294 return false; | 292 return false; |
295 default: | 293 default: |
296 clear(); | 294 clear(); |
297 return setFailed(); | 295 return setFailed(); |
298 } | 296 } |
299 } | 297 } |
300 | 298 |
301 } // namespace WebCore | 299 } // namespace WebCore |
OLD | NEW |