From 3f0ceb91f806737586b2acc39c1efa960a26cf00 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 16 Mar 2017 12:54:48 +0100 Subject: [PATCH] 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 --- tests/auto/other/lancelot/paintcommands.cpp | 12 ++++++------ tests/auto/other/lancelot/scripts/brushes.qps | 9 +++++++++ 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 \nsetBrush noBrush\nsetBrush ", + "setBrush \nsetBrush noBrush\nsetBrush ", "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(caps.at(1)); - if (!pm.isNull()) { // Assume pixmap + QImage img = image_load(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