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>
This commit is contained in:
parent
4e935e35f1
commit
1c56ff73aa
@ -2712,17 +2712,19 @@ static TextureBlendType getBlendType(const QSpanData *data)
|
|||||||
{
|
{
|
||||||
TextureBlendType ft;
|
TextureBlendType ft;
|
||||||
if (data->txop <= QTransform::TxTranslate)
|
if (data->txop <= QTransform::TxTranslate)
|
||||||
if (data->texture.type == QTextureData::Tiled)
|
if (data->texture.type == QTextureData::Tiled || data->texture.type == QTextureData::Pattern)
|
||||||
ft = BlendTiled;
|
ft = BlendTiled;
|
||||||
else
|
else
|
||||||
ft = BlendUntransformed;
|
ft = BlendUntransformed;
|
||||||
else if (data->bilinear)
|
else if (data->bilinear)
|
||||||
if (data->texture.type == QTextureData::Tiled)
|
if (data->texture.type == QTextureData::Tiled || data->texture.type == QTextureData::Pattern)
|
||||||
ft = BlendTransformedBilinearTiled;
|
ft = BlendTransformedBilinearTiled;
|
||||||
else
|
else
|
||||||
ft = BlendTransformedBilinear;
|
ft = BlendTransformedBilinear;
|
||||||
else
|
else
|
||||||
if (data->texture.type == QTextureData::Tiled)
|
if (data->texture.type == QTextureData::Pattern)
|
||||||
|
ft = BlendTiled;
|
||||||
|
else if (data->texture.type == QTextureData::Tiled)
|
||||||
ft = BlendTransformedTiled;
|
ft = BlendTransformedTiled;
|
||||||
else
|
else
|
||||||
ft = BlendTransformed;
|
ft = BlendTransformed;
|
||||||
|
@ -321,7 +321,8 @@ struct QTextureData
|
|||||||
bool hasAlpha;
|
bool hasAlpha;
|
||||||
enum Type {
|
enum Type {
|
||||||
Plain,
|
Plain,
|
||||||
Tiled
|
Tiled,
|
||||||
|
Pattern
|
||||||
};
|
};
|
||||||
Type type;
|
Type type;
|
||||||
int const_alpha;
|
int const_alpha;
|
||||||
|
@ -4587,7 +4587,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||||||
if (!tempImage)
|
if (!tempImage)
|
||||||
tempImage = new QImage();
|
tempImage = new QImage();
|
||||||
*tempImage = rasterBuffer->colorizeBitmap(qt_imageForBrush(brushStyle, true), brush.color());
|
*tempImage = rasterBuffer->colorizeBitmap(qt_imageForBrush(brushStyle, true), brush.color());
|
||||||
initTexture(tempImage, alpha, QTextureData::Tiled);
|
initTexture(tempImage, alpha, QTextureData::Pattern);
|
||||||
break;
|
break;
|
||||||
case Qt::TexturePattern:
|
case Qt::TexturePattern:
|
||||||
type = Texture;
|
type = Texture;
|
||||||
|
Loading…
Reference in New Issue
Block a user