From cf9b3c334d70d5018b438f37518b057ead9199c0 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 10 Aug 2014 12:22:56 +0200 Subject: Remove QQuickWindow::glslVersion & glslIsCoreProfile Superceded by the OpenGLInfo attached type => remove the API before it gets released Change-Id: I7511fd28eb375eb3cd3cdd4bda6d82c1883e3094 Reviewed-by: Shawn Rutledge Reviewed-by: Alan Alpert --- src/quick/items/qquickwindow.cpp | 81 ---------------------------------------- src/quick/items/qquickwindow.h | 5 --- 2 files changed, 86 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 1971c0a14e..a06f41c045 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -3622,87 +3622,6 @@ void QQuickWindow::resetOpenGLState() QOpenGLFramebufferObject::bindDefault(); } -/*! - \brief QQuickWindow::glslVersion - \since 5.4 - \return The OpenGL Shading Language version for this window. - - QML components that need to be usable on different platforms and environments may need - to deal with different OpenGL versions if they include ShaderEffect items. The source - code for a given shader may not be compatible with an OpenGL context that targets a - different OpenGL version or profile, hence it might be necessary to provide multiple - versions of the shader. This property helps in deciding which shader source should be - chosen. - - The value corresponds to GLSL version declarations, for example an OpenGL 4.2 core - profile context will result in the value \e{420 core}, while an OpenGL ES 3.0 context - gives \e{300 es}. For OpenGL (ES) 2 the value will be an empty string since the - corresponding shading language does not use version declarations. - - \note The value does not necessarily indicate that the shader source must target that - specific version. For example, compatibility profiles and ES 3.x all allow using - OpenGL 2 style shaders. The most important for reusable components is to check for - core profiles since these do not accept shaders with the old syntax. - - \sa setFormat(), glslIsCoreProfile() - */ -QString QQuickWindow::glslVersion() const -{ - QString ver; - QOpenGLContext *ctx = openglContext(); - if (ctx) { - const QSurfaceFormat fmt = ctx->format(); - if (fmt.renderableType() == QSurfaceFormat::OpenGLES - && fmt.majorVersion() >= 3) { - ver += QLatin1Char(fmt.majorVersion() + '0'); - ver += QLatin1Char(fmt.minorVersion() + '0'); - ver += QLatin1String("0 es"); - } else if (fmt.renderableType() == QSurfaceFormat::OpenGL - && fmt.majorVersion() >= 3) { - if (fmt.version() == qMakePair(3, 0)) { - ver = QStringLiteral("130"); - } else if (fmt.version() == qMakePair(3, 1)) { - ver = QStringLiteral("140"); - } else if (fmt.version() == qMakePair(3, 2)) { - ver = QStringLiteral("150"); - } else { - ver += QLatin1Char(fmt.majorVersion() + '0'); - ver += QLatin1Char(fmt.minorVersion() + '0'); - ver += QLatin1Char('0'); - } - if (fmt.version() >= qMakePair(3, 2)) { - if (fmt.profile() == QSurfaceFormat::CoreProfile) - ver += QStringLiteral(" core"); - else if (fmt.profile() == QSurfaceFormat::CompatibilityProfile) - ver += QStringLiteral(" compatibility"); - } - } - } - return ver; -} - -/*! - \brief QQuickWindow::glslIsCoreProfile - \since 5.4 - \return True if the window is rendering using OpenGL core profile. - - This is convenience function to check if the window's OpenGL context is a core profile - context. It is more efficient to perform the check via this function than parsing the - string returned from glslVersion(). - - Resusable QML components will typically use this function in bindings in order to - choose between core and non core profile compatible shader sources. - - To retrieve more information about the shading language, use glslVersion(). - - \sa glslVersion(), setFormat() - */ -bool QQuickWindow::glslIsCoreProfile() const -{ - QOpenGLContext *ctx = openglContext(); - return ctx ? ctx->format().profile() == QSurfaceFormat::CoreProfile : false; -} - /*! \qmlproperty string Window::title diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 7757168aa3..89780e4b75 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -70,8 +70,6 @@ class Q_QUICK_EXPORT QQuickWindow : public QWindow Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) Q_PROPERTY(QQuickItem* contentItem READ contentItem CONSTANT) Q_PROPERTY(QQuickItem* activeFocusItem READ activeFocusItem NOTIFY activeFocusItemChanged REVISION 1) - Q_PROPERTY(QString glslVersion READ glslVersion CONSTANT REVISION 2) - Q_PROPERTY(bool glslIsCoreProfile READ glslIsCoreProfile CONSTANT REVISION 2) Q_CLASSINFO("DefaultProperty", "data") Q_DECLARE_PRIVATE(QQuickWindow) public: @@ -150,9 +148,6 @@ public: QOpenGLContext *openglContext() const; - QString glslVersion() const; - bool glslIsCoreProfile() const; - void scheduleRenderJob(QRunnable *job, RenderStage schedule); static QQuickWindowAttached *qmlAttachedProperties(QObject *object); -- cgit v1.2.3