Add lancelot test to exercise tiled non-ARGB32PM bilinear filtering
No test were hitting the code path for tiled non-ARGB32PM bilinear filtered scaling. In part because we were only using brushes in pixmap mode which are always converted to RGB32 or ARGB32PM. Change-Id: Ib466567f31ce6ee894acdf484d44b3af62dad6fc Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>bb10
parent
3e3defb5c3
commit
3f0ceb91f8
|
|
@ -263,7 +263,7 @@ void PaintCommands::staticInit()
|
|||
"path_setFillRule pathName Winding");
|
||||
DECL_PAINTCOMMAND("setBrush", command_setBrush,
|
||||
"^setBrush\\s+(#?[\\w.:\\/]*)\\s*(\\w*)?$",
|
||||
"setBrush <pixmapFileName>\nsetBrush noBrush\nsetBrush <color> <brush style enum>",
|
||||
"setBrush <imageFileName>\nsetBrush noBrush\nsetBrush <color> <brush style enum>",
|
||||
"setBrush white SolidPattern");
|
||||
DECL_PAINTCOMMAND("setBrushOrigin", command_setBrushOrigin,
|
||||
"^setBrushOrigin\\s*(-?\\w*)\\s+(-?\\w*)$",
|
||||
|
|
@ -1752,13 +1752,13 @@ void PaintCommands::command_setBrush(QRegExp re)
|
|||
{
|
||||
QStringList caps = re.capturedTexts();
|
||||
|
||||
QPixmap pm = image_load<QPixmap>(caps.at(1));
|
||||
if (!pm.isNull()) { // Assume pixmap
|
||||
QImage img = image_load<QImage>(caps.at(1));
|
||||
if (!img.isNull()) { // Assume image brush
|
||||
if (m_verboseMode)
|
||||
printf(" -(lance) setBrush(pixmap=%s, width=%d, height=%d)\n",
|
||||
qPrintable(caps.at(1)), pm.width(), pm.height());
|
||||
printf(" -(lance) setBrush(image=%s, width=%d, height=%d)\n",
|
||||
qPrintable(caps.at(1)), img.width(), img.height());
|
||||
|
||||
m_painter->setBrush(QBrush(pm));
|
||||
m_painter->setBrush(QBrush(img));
|
||||
} else if (caps.at(1).toLower() == "nobrush") {
|
||||
m_painter->setBrush(Qt::NoBrush);
|
||||
if (m_verboseMode)
|
||||
|
|
|
|||
|
|
@ -77,3 +77,12 @@ drawRect 0 250 50 50
|
|||
setBrushOrigin 50 250
|
||||
drawRect 50 250 50 50
|
||||
|
||||
|
||||
setBrush dome_indexed.png
|
||||
setPen nopen
|
||||
brushScale 0.7 0.7
|
||||
drawRect 20 320 600 200
|
||||
|
||||
setBrush dome_argb32.png
|
||||
brushScale 1.5 1.5
|
||||
drawRect 20 540 600 200
|
||||
|
|
|
|||
Loading…
Reference in New Issue