diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-15 20:29:27 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-20 13:46:55 +0200 |
commit | 2b98ffeb5fee1577932d02fdaf8d38c623bec01d (patch) | |
tree | 9b5cc9a159532eafd97e3b07e9a4307c803b5e31 /src | |
parent | 303ca9f4cf0fe836c7413e7317e209f9be3bf69e (diff) |
Remove OpenGLInfo
Deprecated since 5.8. Replaced by GraphicsInfo.
Change-Id: Ia8133b3c14fb57ed8ba2c40488f485f3c00ee036
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/quick/items/items.pri | 2 | ||||
-rw-r--r-- | src/quick/items/qquickitemsmodule.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquickopenglinfo.cpp | 206 | ||||
-rw-r--r-- | src/quick/items/qquickopenglinfo_p.h | 124 |
5 files changed, 0 insertions, 336 deletions
diff --git a/src/quick/CMakeLists.txt b/src/quick/CMakeLists.txt index e09d243e4e..26a7d13100 100644 --- a/src/quick/CMakeLists.txt +++ b/src/quick/CMakeLists.txt @@ -451,7 +451,6 @@ qt_extend_target(Quick CONDITION QT_FEATURE_quick_path qt_extend_target(Quick CONDITION QT_FEATURE_opengl OR QT_FEATURE_opengles2 OR QT_FEATURE_opengles3 SOURCES items/qquickframebufferobject.cpp items/qquickframebufferobject.h - items/qquickopenglinfo.cpp items/qquickopenglinfo_p.h scenegraph/compressedtexture/qsgcompressedatlastexture.cpp scenegraph/compressedtexture/qsgcompressedatlastexture_p.h scenegraph/compressedtexture/qsgcompressedtexture.cpp scenegraph/compressedtexture/qsgcompressedtexture_p.h scenegraph/coreapi/qsgbatchrenderer.cpp scenegraph/coreapi/qsgbatchrenderer_p.h diff --git a/src/quick/items/items.pri b/src/quick/items/items.pri index 2d232a0b0a..aeb7e72fd0 100644 --- a/src/quick/items/items.pri +++ b/src/quick/items/items.pri @@ -255,11 +255,9 @@ qtConfig(quick-sprite) { # Items that depend on OpenGL Renderer qtConfig(opengl(es1|es2)?) { SOURCES += \ - $$PWD/qquickopenglinfo.cpp \ $$PWD/qquickframebufferobject.cpp HEADERS += \ - $$PWD/qquickopenglinfo_p.h \ $$PWD/qquickframebufferobject.h } diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 125518e51b..12d9a499e4 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -101,9 +101,6 @@ #include "qquickspritesequence_p.h" #include "qquickanimatedsprite_p.h" #endif -#if QT_CONFIG(opengl) -# include "qquickopenglinfo_p.h" -#endif #include "qquickgraphicsinfo_p.h" #if QT_CONFIG(quick_shadereffect) #include <QtQuick/private/qquickshadereffectsource_p.h> diff --git a/src/quick/items/qquickopenglinfo.cpp b/src/quick/items/qquickopenglinfo.cpp deleted file mode 100644 index 294572e693..0000000000 --- a/src/quick/items/qquickopenglinfo.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 BlackBerry Ltd. -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick module 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 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 Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** 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-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qquickopenglinfo_p.h" -#include "qopenglcontext.h" -#include "qquickwindow.h" -#include "qquickwindow_p.h" -#include "qquickitem.h" -#include "qquickitem_p.h" - -QT_BEGIN_NAMESPACE - -/*! - \qmltype OpenGLInfo - \instantiates QQuickOpenGLInfo - \inqmlmodule QtQuick - \ingroup qtquick-effects - \since 5.4 - \brief Provides information about the used OpenGL version. - - The OpenGLInfo attached type provides information about the OpenGL - version being used to render the surface of the attachee item. - - If the attachee item is not currently associated with any graphical - surface, the properties are set to the values of the default surface - format. When it becomes associated with a surface, all properties - will update. - - \deprecated - - \warning This type is deprecated. Use GraphicsInfo instead. - - \sa ShaderEffect - */ -QQuickOpenGLInfo::QQuickOpenGLInfo(QQuickItem *item) - : QObject(item) - , m_window(nullptr) - , m_majorVersion(2) - , m_minorVersion(0) - , m_profile(NoProfile) - , m_renderableType(Unspecified) -{ - connect(item, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(setWindow(QQuickWindow*))); - setWindow(item->window()); -} - -/*! - \qmlproperty int QtQuick::OpenGLInfo::majorVersion - - This property holds the major OpenGL version. - - The default version is \c 2.0. - - \sa minorVersion, profile - */ -int QQuickOpenGLInfo::majorVersion() const -{ - return m_majorVersion; -} - -/*! - \qmlproperty int QtQuick::OpenGLInfo::minorVersion - - This property holds the minor OpenGL version. - - The default version is \c 2.0. - - \sa majorVersion, profile - */ -int QQuickOpenGLInfo::minorVersion() const -{ - return m_minorVersion; -} - -/*! - \qmlproperty enumeration QtQuick::OpenGLInfo::profile - - This property holds the configured OpenGL context profile. - - The possible values are: - \list - \li OpenGLInfo.NoProfile (default) - OpenGL version is lower than 3.2. - \li OpenGLInfo.CoreProfile - Functionality deprecated in OpenGL version 3.0 is not available. - \li OpenGLInfo.CompatibilityProfile - Functionality from earlier OpenGL versions is available. - \endlist - - Reusable QML components will typically use this property in bindings in order to - choose between core and non core profile compatible shader sources. - - \sa majorVersion, minorVersion - */ -QQuickOpenGLInfo::ContextProfile QQuickOpenGLInfo::profile() const -{ - return m_profile; -} - -/*! - \qmlproperty enumeration QtQuick::OpenGLInfo::renderableType - - This property holds the renderable type. - - The possible values are: - \list - \li OpenGLInfo.Unspecified (default) - Unspecified rendering method - \li OpenGLInfo.OpenGL - Desktop OpenGL rendering - \li OpenGLInfo.OpenGLES - OpenGL ES rendering - \endlist - */ -QQuickOpenGLInfo::RenderableType QQuickOpenGLInfo::renderableType() const -{ - return m_renderableType; -} - -QQuickOpenGLInfo *QQuickOpenGLInfo::qmlAttachedProperties(QObject *object) -{ - if (QQuickItem *item = qobject_cast<QQuickItem *>(object)) - return new QQuickOpenGLInfo(item); - return nullptr; -} - -void QQuickOpenGLInfo::updateFormat() -{ - QOpenGLContext *context = nullptr; - if (m_window) - context = m_window->openglContext(); - QSurfaceFormat format = context ? context->format() : QSurfaceFormat::defaultFormat(); - - if (m_majorVersion != format.majorVersion()) { - m_majorVersion = format.majorVersion(); - emit majorVersionChanged(); - } - - if (m_minorVersion != format.minorVersion()) { - m_minorVersion = format.minorVersion(); - emit minorVersionChanged(); - } - - ContextProfile profile = static_cast<ContextProfile>(format.profile()); - if (m_profile != profile) { - m_profile = profile; - emit profileChanged(); - } - - RenderableType renderableType = static_cast<RenderableType>(format.renderableType()); - if (m_renderableType != renderableType) { - m_renderableType = renderableType; - emit renderableTypeChanged(); - } -} - -void QQuickOpenGLInfo::setWindow(QQuickWindow *window) -{ - if (m_window != window) { - if (m_window) { - disconnect(m_window, SIGNAL(sceneGraphInitialized()), this, SLOT(updateFormat())); - disconnect(m_window, SIGNAL(sceneGraphInvalidated()), this, SLOT(updateFormat())); - } - if (window) { - connect(window, SIGNAL(sceneGraphInitialized()), this, SLOT(updateFormat())); - connect(window, SIGNAL(sceneGraphInvalidated()), this, SLOT(updateFormat())); - } - m_window = window; - } - updateFormat(); -} - -QT_END_NAMESPACE - -#include "moc_qquickopenglinfo_p.cpp" diff --git a/src/quick/items/qquickopenglinfo_p.h b/src/quick/items/qquickopenglinfo_p.h deleted file mode 100644 index e0c2572b8d..0000000000 --- a/src/quick/items/qquickopenglinfo_p.h +++ /dev/null @@ -1,124 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 BlackBerry Ltd. -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtQuick module 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 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 Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** 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-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QQUICKOPENGLINFO_P_H -#define QQUICKOPENGLINFO_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qobject.h> -#include <QtCore/qpointer.h> -#include <QtGui/qsurfaceformat.h> -#include <QtQml/qqml.h> - -QT_BEGIN_NAMESPACE - -class QQuickItem; -class QQuickWindow; - -class QQuickOpenGLInfo : public QObject -{ - Q_OBJECT - Q_PROPERTY(int majorVersion READ majorVersion NOTIFY majorVersionChanged FINAL) - Q_PROPERTY(int minorVersion READ minorVersion NOTIFY minorVersionChanged FINAL) - Q_PROPERTY(ContextProfile profile READ profile NOTIFY profileChanged FINAL) - Q_PROPERTY(RenderableType renderableType READ renderableType NOTIFY renderableTypeChanged FINAL) - - QML_NAMED_ELEMENT(OpenGLInfo) - QML_UNCREATABLE("OpenGLInfo is only available via attached properties.") - QML_ADDED_IN_VERSION(2, 4) - QML_ATTACHED(QQuickOpenGLInfo) - -public: - QQuickOpenGLInfo(QQuickItem *item = 0); - - int majorVersion() const; - int minorVersion() const; - - // keep in sync with QSurfaceFormat::OpenGLContextProfile - enum ContextProfile { - NoProfile = QSurfaceFormat::NoProfile, - CoreProfile = QSurfaceFormat::CoreProfile, - CompatibilityProfile = QSurfaceFormat::CompatibilityProfile - }; - Q_ENUM(ContextProfile) - ContextProfile profile() const; - - // keep in sync with QSurfaceFormat::RenderableType - enum RenderableType { - Unspecified = QSurfaceFormat::DefaultRenderableType, - OpenGL = QSurfaceFormat::OpenGL, - OpenGLES = QSurfaceFormat::OpenGLES - }; - Q_ENUM(RenderableType) - RenderableType renderableType() const; - - static QQuickOpenGLInfo *qmlAttachedProperties(QObject *object); - -Q_SIGNALS: - void majorVersionChanged(); - void minorVersionChanged(); - void profileChanged(); - void renderableTypeChanged(); - -private Q_SLOTS: - void updateFormat(); - void setWindow(QQuickWindow *window); - -private: - QPointer<QQuickWindow> m_window; - int m_majorVersion; - int m_minorVersion; - ContextProfile m_profile; - RenderableType m_renderableType; -}; - -QT_END_NAMESPACE - -#endif // QQUICKOPENGLINFO_P_H |