Changeset 65227 in webkit
- Timestamp:
- Aug 12, 2010 2:43:50 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65226 r65227 1 2010-08-12 Benjamin Poulain <benjamin.poulain@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Decode images directly to QPixmap 6 https://bugs.webkit.org/show_bug.cgi?id=40797 7 8 Use the new API of Qt 4.7 to decode data from the image 9 reader directly to QPixmap. 10 11 This allow us to use JDCT_IFAST when decoding jpeg images 12 to pixmap, and to decode animated GIF images, while still 13 using in-place conversion of color space. 14 15 * platform/graphics/qt/ImageDecoderQt.cpp: 16 (WebCore::ImageDecoderQt::setData): 17 (WebCore::ImageDecoderQt::internalHandleCurrentImage): 18 1 19 2010-07-14 Marcus Bulach <bulach@chromium.org> 2 20 -
trunk/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
r61534 r65227 79 79 m_reader.set(new QImageReader(m_buffer.get(), m_format)); 80 80 81 // This will force the JPEG decoder to use JDCT_IFAST 82 m_reader->setQuality(49); 83 81 84 // QImageReader only allows retrieving the format before reading the image 82 85 m_format = m_reader->format(); … … 187 190 { 188 191 QPixmap pixmap; 189 bool pixmapLoaded; 190 const int imageCount = m_reader->imageCount(); 191 if (imageCount == 0 || imageCount == 1) 192 pixmapLoaded = pixmap.loadFromData((const uchar*)(m_data->data()), m_data->size(), m_format); 193 else { 194 QImage img; 195 const bool imageLoaded = m_reader->read(&img); 196 if (imageLoaded) { 197 pixmap = QPixmap::fromImage(img); 198 pixmapLoaded = true; 199 } 200 } 201 202 if (!pixmapLoaded) { 192 193 #if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0) 194 pixmap = QPixmap::fromImageReader(m_reader.get()); 195 #else 196 QImage img; 197 if (m_reader->read(&img)) 198 pixmap = QPixmap::fromImage(img); 199 #endif 200 201 if (pixmap.isNull()) { 203 202 frameCount(); 204 203 repetitionCount();
Note: See TracChangeset
for help on using the changeset viewer.