summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-05-14 16:15:05 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-14 18:09:36 +0200
commit18ce42d5e39ce34e38be49c9fcdd78329899a075 (patch)
tree068f47c2eff4de8fbe37e33c9b43d54f45770816
parent33f8f26f0f243413cd50560911a9bb52dbf1a777 (diff)
downloadqtwebkit-18ce42d5e39ce34e38be49c9fcdd78329899a075.tar.gz
Images wastes time on prescaling before OpenGL painting
WebCore prescale images under cirtain circumstances to work-around poor downscaling in the raster QPainter. This is however unnecessary and harmful to performance when using a OpenGL paint engine. This patch makes sure the prescaling logic is only used for the raster paint engine. Change-Id: I321894ee6adec097d827e9997ebf951960ee91a4 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebCore/platform/graphics/qt/ImageQt.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/qt/ImageQt.cpp b/Source/WebCore/platform/graphics/qt/ImageQt.cpp
index 228518f66..9e4408b61 100644
--- a/Source/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -45,6 +45,7 @@
#include <QImage>
#include <QImageReader>
#include <QPainter>
+#include <QPaintEngine>
#include <QPixmap>
#include <QPixmapCache>
#include <QTransform>
@@ -241,6 +242,9 @@ QPixmap* prescaleImageIfRequired(QPainter* painter, QPixmap* image, QPixmap* buf
if (!(painter->renderHints() & QPainter::SmoothPixmapTransform))
return image;
+ if (painter->paintEngine()->type() != QPaintEngine::Raster)
+ return image;
+
QTransform transform = painter->combinedTransform();
// Prescaling transforms that does more than scale or translate is not supported.