diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-04-09 12:37:19 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2018-04-25 13:39:28 +0000 |
commit | bd1fd197caab262a0782742daa01eaa36a108ada (patch) | |
tree | eb3a7dbabb77a798d972f2c165b432b2a9d29994 /src/gui/painting/qpainter.cpp | |
parent | 29b012eb0f913eac724afcb4e1b14a6d71492ff6 (diff) |
Fix drawTiledPixmap() and texture-brush painting with high-DPR images
Although QPainter::drawImage()/drawPixmap() would render images scaled
according to their devicePixelRatio(), that would not happen for
drawTiledPixmap() and when using a textured brush. Implemented here,
in combination with the pending "High-dpi drawTiledPixmap (raster
paint engine)" commit.
[ChangeLog][QtGui] Fix drawTiledPixmap() and texture-brush painting with high-DPR images
Task-number: QTBUG-67248
Change-Id: I037e3f897fa708038a0222d3b0c61c7842d87961
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/painting/qpainter.cpp')
-rw-r--r-- | src/gui/painting/qpainter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b992e8f55d..a0a58cc157 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -190,6 +190,13 @@ void QPainterPrivate::checkEmulation() if (pg && pg->coordinateMode() > QGradient::LogicalMode) doEmulation = true; + if (state->brush.style() == Qt::TexturePattern) { + if (qHasPixmapTexture(state->brush)) + doEmulation |= !qFuzzyCompare(state->brush.texture().devicePixelRatioF(), 1.0); + else + doEmulation |= !qFuzzyCompare(state->brush.textureImage().devicePixelRatioF(), 1.0); + } + if (doEmulation && extended->flags() & QPaintEngineEx::DoNotEmulate) return; |