aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-03-19 11:58:04 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-19 15:48:50 +0100
commit1145d76ebad94acee602c83b59d125337d0ff193 (patch)
treedddd0f02f0bebf05026b1f146853821ce4fecd28 /tests
parentebbabba0a57e756b846ff49c74f3ce1f6acf6824 (diff)
Invalidate all batches potentially affected by a change.
When two separate changes have occurred, we need to not only invalidate the batches directly overlapping those, but also any batch which has render orders between the two. So, keep track of the range of invalidated render orders and invalidate everything in between. Task-number: QTBUG-37422 Change-Id: Ie5a289d5c569b84917ec9ac52671173c566e69b3 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/scenegraph/data/render_bug37422.qml103
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp1
2 files changed, 104 insertions, 0 deletions
diff --git a/tests/auto/quick/scenegraph/data/render_bug37422.qml b/tests/auto/quick/scenegraph/data/render_bug37422.qml
new file mode 100644
index 0000000000..38e2b64da7
--- /dev/null
+++ b/tests/auto/quick/scenegraph/data/render_bug37422.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Jolla Ltd, author: <gunnar.sletta@jollamobile.com>
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.2
+
+/*
+ The test verifies that batching does not interfere with overlapping
+ regions.
+
+ #samples: 8
+ PixelPos R G B Error-tolerance
+ #base: 0 0 1.0 0.0 0.0 0.05
+ #base: 1 1 0.0 0.0 1.0 0.05
+ #base: 10 10 1.0 0.0 0.0 0.05
+ #base: 1 11 0.0 0.0 1.0 0.05
+
+ #final: 0 0 1.0 0.0 0.0 0.05
+ #final: 1 1 0.0 1.0 0.0 0.05
+ #final: 10 10 1.0 0.0 0.0 0.05
+ #final: 1 11 0.0 1.0 0.0 0.05
+
+*/
+
+RenderTestBase
+{
+ id: root
+
+ opacity: 0.99
+
+ Rectangle {
+ width: 100
+ height: 9
+ color: Qt.rgba(1, 0, 0);
+
+ Rectangle {
+ id: box
+ width: 5
+ height: 5
+ x: 1
+ y: 1
+ color: Qt.rgba(0, 0, 1);
+ }
+ }
+
+ ShaderEffect { // Something which blends and is different than rectangle. Will get its own batch
+ width: 100
+ height: 9
+ y: 10
+ fragmentShader: "varying highp vec2 qt_TexCoord0; void main() { gl_FragColor = vec4(1, 0, 0, 1); }"
+
+ Rectangle {
+ width: 5
+ height: 5
+ x: 1
+ y: 1
+ color: box.color
+ }
+ }
+
+ onEnterFinalStage: {
+ box.color = Qt.rgba(0, 1, 0);
+ root.finalStageComplete = true;
+ }
+
+}
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index c3d237a806..ac4938e8bc 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -328,6 +328,7 @@ void tst_SceneGraph::render_data()
<< "data/render_StackingOrder.qml"
<< "data/render_Mipmap.qml"
<< "data/render_ImageFiltering.qml"
+ << "data/render_bug37555.qml"
;
QRegExp sampleCount("#samples: *(\\d+)");