diff options
Diffstat (limited to 'tests/auto/gui/qopengl/tst_qopengl.cpp')
-rw-r--r-- | tests/auto/gui/qopengl/tst_qopengl.cpp | 54 |
1 files changed, 22 insertions, 32 deletions
diff --git a/tests/auto/gui/qopengl/tst_qopengl.cpp b/tests/auto/gui/qopengl/tst_qopengl.cpp index e2e7f153a0..af59f3e31a 100644 --- a/tests/auto/gui/qopengl/tst_qopengl.cpp +++ b/tests/auto/gui/qopengl/tst_qopengl.cpp @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtOpenGL/QOpenGLFramebufferObject> #include <QtOpenGL/QOpenGLPaintDevice> @@ -32,7 +7,9 @@ #include <QtOpenGL/qopengltextureblitter.h> #include <QtOpenGL/QOpenGLVertexArrayObject> #include <QtOpenGL/QOpenGLBuffer> -#include <QtOpenGL/QOpenGLFunctions_4_2_Core> +#if !QT_CONFIG(opengles2) +# include <QtOpenGL/QOpenGLFunctions_4_2_Core> +#endif #include <QtOpenGL/QOpenGLVersionFunctionsFactory> #include <QtGui/private/qopenglcontext_p.h> #include <QtGui/QOpenGLFunctions> @@ -643,6 +620,10 @@ static bool supportsInternalFboFormat(QOpenGLContext *ctx, int glFormat) void tst_QOpenGL::fboRenderingRGB30() { +#ifdef Q_OS_ANDROID + if (QNativeInterface::QAndroidApplication::sdkVersion() >= 31) + QSKIP("Fails on Android 12 (QTBUG-105738)"); +#endif #if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(__x86_64__) QSKIP("QTBUG-22617"); #endif @@ -1182,6 +1163,7 @@ void tst_QOpenGL::sizeLessWindow() // child window { QWindow parent; + parent.setSurfaceType(QWindow::OpenGLSurface); QWindow window(&parent); window.setSurfaceType(QWindow::OpenGLSurface); @@ -1610,6 +1592,13 @@ void tst_QOpenGL::bufferCreate() buf.allocate(128); QCOMPARE(buf.size(), 128); + { + QOpenGLBuffer moved = std::move(buf); + QCOMPARE_EQ(moved.isCreated(), true); + QCOMPARE_EQ(moved.size(), 128); + buf = std::move(moved); + } + buf.release(); buf.destroy(); @@ -1695,10 +1684,11 @@ void tst_QOpenGL::nullTextureInitializtion() /* Verify that the clipping works correctly. - The red outline should be covered by the blue rect on top and left, - while it should be clipped on the right and bottom and thus the red outline be visible + Just like fillRect, cliprect should snap rightwards and downwards in case of .5 coordinates. + The red outline should be covered by the blue rect on top, + while it should be clipped on the other edges and thus the red outline be visible - See: QTBUG-83229 + See: QTBUG-83229, modified by QTBUG-100329 */ void tst_QOpenGL::clipRect() { @@ -1754,7 +1744,7 @@ void tst_QOpenGL::clipRect() QCOMPARE(fb.size(), size); QCOMPARE(fb.pixelColor(clipRect.left() + 1, clipRect.top()), QColor(Qt::blue)); - QCOMPARE(fb.pixelColor(clipRect.left(), clipRect.top() + 1), QColor(Qt::blue)); + QCOMPARE(fb.pixelColor(clipRect.left(), clipRect.top() + 1), QColor(Qt::red)); QCOMPARE(fb.pixelColor(clipRect.left() + 1, clipRect.bottom()), QColor(Qt::red)); // Enable this once QTBUG-85286 is fixed |