summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2014-01-31 14:47:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-31 18:26:56 +0100
commitb7d359c66471fb9fe1592d77f8711fe439ac7028 (patch)
tree07569063a503575803447812333465f01a9075fd
parent64a4dc759958b289a6b1ecb5cb4adc91f4cbef07 (diff)
Apply device pixel ratio to transparency layers
The transparency layers are currently created with taking hiDPI into account. This means that any CSS opacity causes a shift in rendering quality. This patch forwards the device pixelratio for any QPaintDevice to transparency layers created for that device. Change-Id: Ie65f76771a4cc59bc714a9b89511cab1f7617abc Reviewed-by: Michael Bruning <michael.bruning@digia.com>
-rw-r--r--Source/WebCore/platform/graphics/qt/TransparencyLayer.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/qt/TransparencyLayer.h b/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
index f13deb03b..0312690e0 100644
--- a/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
+++ b/Source/WebCore/platform/graphics/qt/TransparencyLayer.h
@@ -46,11 +46,13 @@ struct TransparencyLayer {
WTF_MAKE_FAST_ALLOCATED;
public:
TransparencyLayer(const QPainter* p, const QRect &rect, qreal opacity, QPixmap& alphaMask)
- : pixmap(rect.width(), rect.height())
- , opacity(opacity)
+ : opacity(opacity)
, alphaMask(alphaMask)
, saveCounter(1) // see the comment for saveCounter
{
+ int devicePixelRatio = p->device()->devicePixelRatio();
+ pixmap = QPixmap(rect.width() * devicePixelRatio, rect.height() * devicePixelRatio);
+ pixmap.setDevicePixelRatio(devicePixelRatio);
offset = rect.topLeft();
pixmap.fill(Qt::transparent);
painter.begin(&pixmap);