Add OpenGL prefixes to ContextProfile in GraphicsInfo

Make it clear with the naming that this is specific to OpenGL.

Change-Id: Ib2106c1539ee424a0d208d17c684c3bb9ad28fa9
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
This commit is contained in:
Laszlo Agocs 2016-06-02 16:55:26 +02:00
parent a48ca7e319
commit 878baeda2b
2 changed files with 13 additions and 13 deletions

View File

@ -70,7 +70,7 @@ QQuickGraphicsInfo::QQuickGraphicsInfo(QQuickItem *item)
, m_shaderSourceType(ShaderSourceType(0)) , m_shaderSourceType(ShaderSourceType(0))
, m_majorVersion(2) , m_majorVersion(2)
, m_minorVersion(0) , m_minorVersion(0)
, m_profile(NoProfile) , m_profile(OpenGLNoProfile)
, m_renderableType(SurfaceFormatUnspecified) , m_renderableType(SurfaceFormatUnspecified)
{ {
connect(item, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(setWindow(QQuickWindow*))); connect(item, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(setWindow(QQuickWindow*)));
@ -211,9 +211,9 @@ QQuickGraphicsInfo *QQuickGraphicsInfo::qmlAttachedProperties(QObject *object)
The possible values are: The possible values are:
\list \list
\li GraphicsInfo.NoProfile (default) - OpenGL version is lower than 3.2 or OpenGL is not in use. \li GraphicsInfo.OpenGLNoProfile (default) - OpenGL version is lower than 3.2 or OpenGL is not in use.
\li GraphicsInfo.CoreProfile - Functionality deprecated in OpenGL version 3.0 is not available. \li GraphicsInfo.OpenGLCoreProfile - Functionality deprecated in OpenGL version 3.0 is not available.
\li GraphicsInfo.CompatibilityProfile - Functionality from earlier OpenGL versions is available. \li GraphicsInfo.OpenGLCompatibilityProfile - Functionality from earlier OpenGL versions is available.
\endlist \endlist
Reusable QML components will typically use this property in bindings in order to Reusable QML components will typically use this property in bindings in order to
@ -275,7 +275,7 @@ void QQuickGraphicsInfo::updateInfo()
m_minorVersion = format.minorVersion(); m_minorVersion = format.minorVersion();
emit minorVersionChanged(); emit minorVersionChanged();
} }
ContextProfile profile = static_cast<ContextProfile>(format.profile()); OpenGLContextProfile profile = static_cast<OpenGLContextProfile>(format.profile());
if (m_profile != profile) { if (m_profile != profile) {
m_profile = profile; m_profile = profile;
emit profileChanged(); emit profileChanged();

View File

@ -72,7 +72,7 @@ class QQuickGraphicsInfo : public QObject
Q_PROPERTY(int majorVersion READ majorVersion NOTIFY majorVersionChanged FINAL) Q_PROPERTY(int majorVersion READ majorVersion NOTIFY majorVersionChanged FINAL)
Q_PROPERTY(int minorVersion READ minorVersion NOTIFY minorVersionChanged FINAL) Q_PROPERTY(int minorVersion READ minorVersion NOTIFY minorVersionChanged FINAL)
Q_PROPERTY(ContextProfile profile READ profile NOTIFY profileChanged FINAL) Q_PROPERTY(OpenGLContextProfile profile READ profile NOTIFY profileChanged FINAL)
Q_PROPERTY(RenderableType renderableType READ renderableType NOTIFY renderableTypeChanged FINAL) Q_PROPERTY(RenderableType renderableType READ renderableType NOTIFY renderableTypeChanged FINAL)
public: public:
@ -104,12 +104,12 @@ public:
}; };
Q_ENUM(ShaderSourceType) Q_ENUM(ShaderSourceType)
enum ContextProfile { enum OpenGLContextProfile {
NoProfile = QSurfaceFormat::NoProfile, OpenGLNoProfile = QSurfaceFormat::NoProfile,
CoreProfile = QSurfaceFormat::CoreProfile, OpenGLCoreProfile = QSurfaceFormat::CoreProfile,
CompatibilityProfile = QSurfaceFormat::CompatibilityProfile OpenGLCompatibilityProfile = QSurfaceFormat::CompatibilityProfile
}; };
Q_ENUM(ContextProfile) Q_ENUM(OpenGLContextProfile)
enum RenderableType { enum RenderableType {
SurfaceFormatUnspecified = QSurfaceFormat::DefaultRenderableType, SurfaceFormatUnspecified = QSurfaceFormat::DefaultRenderableType,
@ -129,7 +129,7 @@ public:
int majorVersion() const { return m_majorVersion; } int majorVersion() const { return m_majorVersion; }
int minorVersion() const { return m_minorVersion; } int minorVersion() const { return m_minorVersion; }
ContextProfile profile() const { return m_profile; } OpenGLContextProfile profile() const { return m_profile; }
RenderableType renderableType() const { return m_renderableType; } RenderableType renderableType() const { return m_renderableType; }
Q_SIGNALS: Q_SIGNALS:
@ -155,7 +155,7 @@ private:
ShaderSourceType m_shaderSourceType; ShaderSourceType m_shaderSourceType;
int m_majorVersion; int m_majorVersion;
int m_minorVersion; int m_minorVersion;
ContextProfile m_profile; OpenGLContextProfile m_profile;
RenderableType m_renderableType; RenderableType m_renderableType;
}; };