summaryrefslogtreecommitdiff
path: root/Source/WebCore/platform
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-06-15 10:01:29 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-15 10:02:14 +0200
commit98678e1ae981e2e7d52ac283028e352a1cba794a (patch)
tree5035bb87666620ebdd66b758701ab4d862575862 /Source/WebCore/platform
parent01fa9be55572ddb3f69befc68475ed09241eabdf (diff)
parent28077218067438fef5cdc746feb45ca6d4e755d9 (diff)
downloadqtwebkit-98678e1ae981e2e7d52ac283028e352a1cba794a.tar.gz
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts: .qmake.conf Change-Id: Ic399cf8fef1f26f22338a67393066d69cd969579
Diffstat (limited to 'Source/WebCore/platform')
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp2
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageQt.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
index 74696c23d..c93c79b1b 100644
--- a/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageDecoderQt.cpp
@@ -93,7 +93,7 @@ void ImageDecoderQt::setData(SharedBuffer* data, bool allDataReceived)
// QImageReader only allows retrieving the format before reading the image
m_format = m_reader->format();
- if (!isFormatWhiteListed(m_format)) {
+ if (!m_format.isEmpty() && !isFormatWhiteListed(m_format)) {
qWarning("Image of format '%s' blocked because it is not considered safe. If you are sure it is safe to do so, you can white-list the format by setting the environment variable QTWEBKIT_IMAGEFORMAT_WHITELIST=%s", m_format.constData(), m_format.constData());
setFailed();
m_reader.clear();
diff --git a/Source/WebCore/platform/graphics/qt/ImageQt.cpp b/Source/WebCore/platform/graphics/qt/ImageQt.cpp
index 9e4408b61..f30284b90 100644
--- a/Source/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -156,6 +156,8 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
if (tr.x() || tr.y() || tr.width() != pixmap.width() || tr.height() != pixmap.height())
pixmap = pixmap.copy(tr);
+ QPoint trTopLeft = tr.topLeft();
+
CompositeOperator previousOperator = ctxt->compositeOperation();
ctxt->setCompositeOperation(!pixmap.hasAlpha() && op == CompositeSourceOver ? CompositeCopy : op);
@@ -180,13 +182,14 @@ void Image::drawPattern(GraphicsContext* ctxt, const FloatRect& tileRect, const
painter.drawPixmap(QRect(0, 0, scaledPixmap.width(), scaledPixmap.height()), pixmap);
}
pixmap = scaledPixmap;
+ trTopLeft = transform.map(trTopLeft);
transform = QTransform::fromTranslate(transform.dx(), transform.dy());
}
}
/* Translate the coordinates as phase is not in world matrix coordinate space but the tile rect origin is. */
transform *= QTransform().translate(phase.x(), phase.y());
- transform.translate(tr.x(), tr.y());
+ transform.translate(trTopLeft.x(), trTopLeft.y());
QBrush b(pixmap);
b.setTransform(transform);