[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hausmann at webkit.org
hausmann at webkit.org
Wed Dec 22 11:57:45 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit f8af163c6324c99be41f04e900cc618ca74635a2
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 12 09:43:50 2010 +0000
[Qt] Decode images directly to QPixmap
https://bugs.webkit.org/show_bug.cgi?id=40797
Patch by Benjamin Poulain <benjamin.poulain at nokia.com> on 2010-08-12
Reviewed by Simon Hausmann.
Use the new API of Qt 4.7 to decode data from the image
reader directly to QPixmap.
This allow us to use JDCT_IFAST when decoding jpeg images
to pixmap, and to decode animated GIF images, while still
using in-place conversion of color space.
* platform/graphics/qt/ImageDecoderQt.cpp:
(WebCore::ImageDecoderQt::setData):
(WebCore::ImageDecoderQt::internalHandleCurrentImage):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65227 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 61fb74e..d8ba1c9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-12 Benjamin Poulain <benjamin.poulain at nokia.com>
+
+ Reviewed by Simon Hausmann.
+
+ [Qt] Decode images directly to QPixmap
+ https://bugs.webkit.org/show_bug.cgi?id=40797
+
+ Use the new API of Qt 4.7 to decode data from the image
+ reader directly to QPixmap.
+
+ This allow us to use JDCT_IFAST when decoding jpeg images
+ to pixmap, and to decode animated GIF images, while still
+ using in-place conversion of color space.
+
+ * platform/graphics/qt/ImageDecoderQt.cpp:
+ (WebCore::ImageDecoderQt::setData):
+ (WebCore::ImageDecoderQt::internalHandleCurrentImage):
+
2010-07-14 Marcus Bulach <bulach at chromium.org>
Reviewed by darin at apple.com.
diff --git a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index fb3d621..858cc44 100644
--- a/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -78,6 +78,9 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
m_buffer->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
m_reader.set(new QImageReader(m_buffer.get(), m_format));
+ // This will force the JPEG decoder to use JDCT_IFAST
+ m_reader->setQuality(49);
+
// QImageReader only allows retrieving the format before reading the image
m_format = m_reader->format();
}
@@ -186,20 +189,16 @@ void ImageDecoderQt::internalReadImage(size_t frameIndex)
bool ImageDecoderQt::internalHandleCurrentImage(size_t frameIndex)
{
QPixmap pixmap;
- bool pixmapLoaded;
- const int imageCount = m_reader->imageCount();
- if (imageCount == 0 || imageCount == 1)
- pixmapLoaded = pixmap.loadFromData((const uchar*)(m_data->data()), m_data->size(), m_format);
- else {
- QImage img;
- const bool imageLoaded = m_reader->read(&img);
- if (imageLoaded) {
- pixmap = QPixmap::fromImage(img);
- pixmapLoaded = true;
- }
- }
- if (!pixmapLoaded) {
+#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
+ pixmap = QPixmap::fromImageReader(m_reader.get());
+#else
+ QImage img;
+ if (m_reader->read(&img))
+ pixmap = QPixmap::fromImage(img);
+#endif
+
+ if (pixmap.isNull()) {
frameCount();
repetitionCount();
clearPointers();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list