summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/platform/image-decoders
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-21 14:25:39 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-21 14:25:39 (GMT)
commit33ccc95da472e2932514e3df43ffc1df33855ded (patch)
treefaeee0bf3ad3dc1a5b46f847ef4d3f7c86204c82 /src/3rdparty/webkit/WebCore/platform/image-decoders
parent4bc894400ffb4ad07babe9b45ed53ceb2d986418 (diff)
downloadQt-33ccc95da472e2932514e3df43ffc1df33855ded.zip
Qt-33ccc95da472e2932514e3df43ffc1df33855ded.tar.gz
Qt-33ccc95da472e2932514e3df43ffc1df33855ded.tar.bz2
Updated WebKit to 45d1c9149ef8940081fa8dd35854d2b95ebaf3cd
Integrated changes: || <https://webkit.org/b/6274> || text repainting does not account for glyphs which draw outside the typographic bounds of the font || || <https://webkit.org/b/40840> || [Qt] Symbian builds in release sometimes try to link with the debug JavaScriptCore static lib. || || <https://webkit.org/b/40620> || [Qt] Get rid of the the unused imageSize of ImageDecoderQt::internalHandleCurrentImage() || || <https://webkit.org/b/37292> || http://trac.webkit.org/changeset/57215 caused perf regressions || || <https://webkit.org/b/40077> || [Qt] Implement the simple font code path. || || <https://webkit.org/b/40910> || [Qt] Avoid unnecessary image conversion in RGBA32Buffer::zeroFill() || || <https://webkit.org/b/40797> || [Qt] Decode images directly to QPixmap || || <https://webkit.org/b/36510> || [chromium] use integral glyph widths ||
Diffstat (limited to 'src/3rdparty/webkit/WebCore/platform/image-decoders')
-rw-r--r--src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h7
-rw-r--r--src/3rdparty/webkit/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp31
2 files changed, 25 insertions, 13 deletions
diff --git a/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h b/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
index d526e5e..1074753 100644
--- a/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/src/3rdparty/webkit/WebCore/platform/image-decoders/ImageDecoder.h
@@ -40,6 +40,7 @@
#if PLATFORM(SKIA)
#include "NativeImageSkia.h"
#elif PLATFORM(QT)
+#include <QPixmap>
#include <QImage>
#endif
@@ -130,8 +131,7 @@ namespace WebCore {
}
#if PLATFORM(QT)
- void setDecodedImage(const QImage& image);
- QImage decodedImage() const { return m_image; }
+ void setPixmap(const QPixmap& pixmap);
#endif
private:
@@ -143,6 +143,8 @@ namespace WebCore {
#if PLATFORM(SKIA)
return m_bitmap.getAddr32(x, y);
#elif PLATFORM(QT)
+ m_image = m_pixmap.toImage();
+ m_pixmap = QPixmap();
return reinterpret_cast<QRgb*>(m_image.scanLine(y)) + x;
#else
return m_bytes.data() + (y * width()) + x;
@@ -168,6 +170,7 @@ namespace WebCore {
#if PLATFORM(SKIA)
NativeImageSkia m_bitmap;
#elif PLATFORM(QT)
+ mutable QPixmap m_pixmap;
mutable QImage m_image;
bool m_hasAlpha;
IntSize m_size;
diff --git a/src/3rdparty/webkit/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp b/src/3rdparty/webkit/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
index b2e5e17..044515a 100644
--- a/src/3rdparty/webkit/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
+++ b/src/3rdparty/webkit/WebCore/platform/image-decoders/qt/RGBA32BufferQt.cpp
@@ -57,6 +57,7 @@ RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other)
void RGBA32Buffer::clear()
{
+ m_pixmap = QPixmap();
m_image = QImage();
m_status = FrameEmpty;
// NOTE: Do not reset other members here; clearFrameBufferCache()
@@ -67,7 +68,11 @@ void RGBA32Buffer::clear()
void RGBA32Buffer::zeroFill()
{
- m_image.fill(0);
+ if (m_pixmap.isNull() && !m_image.isNull()) {
+ m_pixmap = QPixmap(m_image.width(), m_image.height());
+ m_image = QImage();
+ }
+ m_pixmap.fill(QColor(0, 0, 0, 0));
}
void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
@@ -76,6 +81,7 @@ void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other)
return;
m_image = other.m_image;
+ m_pixmap = other.m_pixmap;
m_size = other.m_size;
m_hasAlpha = other.m_hasAlpha;
}
@@ -87,8 +93,9 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
ASSERT(width() == 0 && height() == 0);
m_size = IntSize(newWidth, newHeight);
- m_image = QImage(newWidth, newHeight, QImage::Format_ARGB32_Premultiplied);
- if (m_image.isNull())
+ m_image = QImage();
+ m_pixmap = QPixmap(newWidth, newHeight);
+ if (m_pixmap.isNull())
return false;
// Zero the image.
@@ -99,10 +106,11 @@ bool RGBA32Buffer::setSize(int newWidth, int newHeight)
QPixmap* RGBA32Buffer::asNewNativeImage() const
{
- QPixmap pix = QPixmap::fromImage(m_image);
- m_image = QImage();
-
- return new QPixmap(pix);
+ if (m_pixmap.isNull() && !m_image.isNull()) {
+ m_pixmap = QPixmap::fromImage(m_image);
+ m_image = QImage();
+ }
+ return new QPixmap(m_pixmap);
}
bool RGBA32Buffer::hasAlpha() const
@@ -121,11 +129,12 @@ void RGBA32Buffer::setStatus(FrameStatus status)
}
// The image must not have format 8888 pre multiplied...
-void RGBA32Buffer::setDecodedImage(const QImage& image)
+void RGBA32Buffer::setPixmap(const QPixmap& pixmap)
{
- m_image = image;
- m_size = image.size();
- m_hasAlpha = image.hasAlphaChannel();
+ m_pixmap = pixmap;
+ m_image = QImage();
+ m_size = pixmap.size();
+ m_hasAlpha = pixmap.hasAlphaChannel();
}
int RGBA32Buffer::width() const