summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-11-18 16:20:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-20 13:59:11 +0100
commit692211670b377014c4dcf7b6819723bbeb2ffa66 (patch)
tree616f0549b8f093fb42326ea93af205a1e6958516
parent5b38d395a821967b48406faf18f638e252d627fa (diff)
downloadqtquickcontrols-692211670b377014c4dcf7b6819723bbeb2ffa66.tar.gz
Fix retina rendering issues with Qt Quick Controls
We need to scale the texture size since it has twice the pixel count on retina macs. Task-number: QTBUG-34922 Change-Id: I38ff316016ccb1e609037598f7107d62b3ba4295 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
-rw-r--r--src/controls/Private/qquickstyleitem.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/controls/Private/qquickstyleitem.cpp b/src/controls/Private/qquickstyleitem.cpp
index a14a22d1..566a46f8 100644
--- a/src/controls/Private/qquickstyleitem.cpp
+++ b/src/controls/Private/qquickstyleitem.cpp
@@ -112,7 +112,7 @@ public:
}
void initialize(QSGTexture *texture,
- const QRectF &bounds,
+ const QRectF &bounds, qreal devicePixelRatio,
int left, int top, int right, int bottom) {
delete m_material.texture();
@@ -127,6 +127,9 @@ public:
QRectF tc = texture->normalizedTextureSubRect();
QSize ts = texture->textureSize();
+ ts.setHeight(ts.height() / devicePixelRatio);
+ ts.setWidth(ts.width() / devicePixelRatio);
+
qreal invtw = tc.width() / ts.width();
qreal invth = tc.height() / ts.height();
@@ -1661,6 +1664,7 @@ QSGNode *QQuickStyleItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
styleNode->initialize(window()->createTextureFromImage(m_image, QQuickWindow::TextureCanUseAtlas),
boundingRect(),
+ window()->devicePixelRatio(),
m_border.left(), m_border.top(), m_border.right(), m_border.bottom());
return styleNode;
}