diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-11 11:27:11 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-11-13 10:08:49 +0100 |
commit | 1c56ff73aa7f81d543f1b697c2db8cb2b67697ab (patch) | |
tree | fda171c969de6d952d72f27315a7e743f9cdb4c7 /src/gui | |
parent | 4e935e35f1abdc8fb8313c04b1605b78b75a50be (diff) |
Fix scaling of basic patterns under HiDPI
The dense patterns should not be non-smoothly scaled, just repeated
more.
Change-Id: I869556039ea1c91773bf2bc83d236b4592bcfc66
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 8 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 3 | ||||
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 1ef881efee..ee0e17d917 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -2712,17 +2712,19 @@ static TextureBlendType getBlendType(const QSpanData *data) { TextureBlendType ft; if (data->txop <= QTransform::TxTranslate) - if (data->texture.type == QTextureData::Tiled) + if (data->texture.type == QTextureData::Tiled || data->texture.type == QTextureData::Pattern) ft = BlendTiled; else ft = BlendUntransformed; else if (data->bilinear) - if (data->texture.type == QTextureData::Tiled) + if (data->texture.type == QTextureData::Tiled || data->texture.type == QTextureData::Pattern) ft = BlendTransformedBilinearTiled; else ft = BlendTransformedBilinear; else - if (data->texture.type == QTextureData::Tiled) + if (data->texture.type == QTextureData::Pattern) + ft = BlendTiled; + else if (data->texture.type == QTextureData::Tiled) ft = BlendTransformedTiled; else ft = BlendTransformed; diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 72eba9ea6d..08826bca2f 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -321,7 +321,8 @@ struct QTextureData bool hasAlpha; enum Type { Plain, - Tiled + Tiled, + Pattern }; Type type; int const_alpha; diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index d424845c68..0a4628b158 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -4587,7 +4587,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode if (!tempImage) tempImage = new QImage(); *tempImage = rasterBuffer->colorizeBitmap(qt_imageForBrush(brushStyle, true), brush.color()); - initTexture(tempImage, alpha, QTextureData::Tiled); + initTexture(tempImage, alpha, QTextureData::Pattern); break; case Qt::TexturePattern: type = Texture; |