diff options
author | Ben Murdoch <benm@google.com> | 2010-07-22 15:37:06 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-07-27 10:20:25 +0100 |
commit | 967717af5423377c967781471ee106e2bb4e11c8 (patch) | |
tree | 1e701dc0a12f7f07cce1df4a7681717de77a211b /WebCore/platform/graphics/qt/ImageBufferQt.cpp | |
parent | dcc30a9fca45f634b1d3a12b276d3a0ccce99fc3 (diff) | |
download | external_webkit-967717af5423377c967781471ee106e2bb4e11c8.zip external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.gz external_webkit-967717af5423377c967781471ee106e2bb4e11c8.tar.bz2 |
Merge WebKit at r63859 : Initial merge by git.
Change-Id: Ie8096c63ec7c991c9a9cba8bdd9c3b74a3b8ed62
Diffstat (limited to 'WebCore/platform/graphics/qt/ImageBufferQt.cpp')
-rw-r--r-- | WebCore/platform/graphics/qt/ImageBufferQt.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp index a546def..b4ca617 100644 --- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp +++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp @@ -98,6 +98,14 @@ GraphicsContext* ImageBuffer::context() const return m_context.get(); } +Image* ImageBuffer::imageForRendering() const +{ + if (!m_image) + m_image = StillImage::createForRendering(&m_data.m_pixmap); + + return m_image.get(); +} + Image* ImageBuffer::image() const { if (!m_image) { @@ -178,8 +186,13 @@ PassRefPtr<ImageData> getImageData(const IntRect& rect, const ImageBufferData& i unsigned destBytesPerRow = 4 * rect.width(); unsigned char* destRows = data + desty * destBytesPerRow + destx * 4; for (int y = 0; y < numRows; ++y) { +#if QT_VERSION >= 0x040700 + const quint32* scanLine = reinterpret_cast<const quint32*>(image.constScanLine(y + originy)); +#else + quint32* scanLine = reinterpret_cast<quint32*>(image.scanLine(y + originy)); +#endif for (int x = 0; x < numColumns; x++) { - QRgb value = image.pixel(x + originx, y + originy); + QRgb value = scanLine[x + originx]; int basex = x * 4; destRows[basex] = qRed(value); |