diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2015-02-24 11:13:31 +0100 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-04-26 10:39:25 +0000 |
commit | 7160df3a15637acbb6548878d3a0afe294e64a6b (patch) | |
tree | e542d6ff36a3ff5fe43d50dd5adc255f7337fca3 /tests/manual/qopengltextureblitter/main.cpp | |
parent | a9fc91466c2c143bea422d98af24755f43c2b97b (diff) |
High-dpi drawTiledPixmap (raster paint engine)
Implement more consistent behavior for drawTiledPixmap(),
which should produce the same visual tiling pattern
independent of display devicePixelRatio
Consider the following pixmaps and draw calls:
QPixmap px32; // 32x32
QPixmap px64; // 64x64
drawTiledPixmap(QRect(0, 0, 128, 128), px32);
drawTiledPixmap(QRect(0, 0, 128, 128), px64);
On 1x displays this will produce 4x4 and 2x2 tiles,
respectively.
On 2x displays this would previously produce a different
tiling pattern, where the paint engine would tile in
the device pixel coordinate system. Change this to
tile in the device independent coordinate system,
producing the same visual tiling pattern as the 1x case.
It is possible to produce a 4x4 tiling pattern with
high-resolution output from the 64x64 pixmap by setting
the devicePixelRatio:
QPixmap px64;
px64.setDevicePixelRatio(2);
drawTiledPixmap(QRect(0, 0, 128, 128), px64);
This change adds an inverse scale to the image filler
transform that accounts for the pixmap devicePixelRatio.
[ChangeLog][QtGui] QPainter::drawTiledPixmap() now
tiles in the device independent coordinate system.
Change-Id: I4918d274192967f222f181b374571c7c597dcd76
Reviewed-by: Jonathan Courtois <jonathan.courtois@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: 石博文 <sbw@sbw.so>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/manual/qopengltextureblitter/main.cpp')
0 files changed, 0 insertions, 0 deletions