Commit 1c56ff73 authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Fix scaling of basic patterns under HiDPI



The dense patterns should not be non-smoothly scaled, just repeated
more.

Change-Id: I869556039ea1c91773bf2bc83d236b4592bcfc66
Reviewed-by: default avatarEirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@qt.io>
parent 4e935e35
......@@ -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;
......
......@@ -321,7 +321,8 @@ struct QTextureData
bool hasAlpha;
enum Type {
Plain,
Tiled
Tiled,
Pattern
};
Type type;
int const_alpha;
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment