summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/lancelot
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-16 12:54:48 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-03-16 13:46:17 +0000
commit3f0ceb91f806737586b2acc39c1efa960a26cf00 (patch)
tree1958d2ebe9e90772effaea97b2ec4bc383d191c3 /tests/auto/other/lancelot
parent3e3defb5c37cca715a441895d7df0f06f0c2cd89 (diff)
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>
Diffstat (limited to 'tests/auto/other/lancelot')
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp12
-rw-r--r--tests/auto/other/lancelot/scripts/brushes.qps9
2 files changed, 15 insertions, 6 deletions
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 971b9b5fe7..c28812e120 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -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)
diff --git a/tests/auto/other/lancelot/scripts/brushes.qps b/tests/auto/other/lancelot/scripts/brushes.qps
index 82cbff48b9..43a7843601 100644
--- a/tests/auto/other/lancelot/scripts/brushes.qps
+++ b/tests/auto/other/lancelot/scripts/brushes.qps
@@ -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