diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-03-15 13:39:41 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-03-22 09:51:54 +0000 |
commit | 90d98e1330bd46b5defafd5d6b86fa8fe157b48d (patch) | |
tree | 722e2b1d371c6b58144d51b8167faa9d1c86e7f0 /src/quick/items/context2d/qquickcontext2dtexture_p.h | |
parent | e32fb877ec0662dfda41ce490d77d8bf35a377f1 (diff) |
Enable building Qt Quick module with QT_NO_OPENGL defined
Currently the Qt Quick module depends on either the OpenGL or OpenGLES
headers being available at build time. Since we are adding support for
adaptations that do not depend on OpenGL, it should be possible to build
Qt Quick in environments that do not have OpenGL development headers.
This does present many challenges though because in some cases GL types,
and classes that require OpenGL are part of the public APIs. However
since these classes were never available when QT_NO_OPENGL was defined,
it should be possible to redefine the function signatures under this
scenario, since it's not possible to break binary compatibility if there
never were any binaries to break compatibility with.
One of the bigger changes that was necessary to facilitate this change
is creating interfaces out of QSGContext and QSGRenderContext. Here the
default behavior was usage of OpenGL directly, even though subclasses
could override all OpenGL usage. Making them interfaces should bring
QSGContext and QSGRenderContext more in line with the other classes
present in the adaptation layer.
Change-Id: Iaa54dc0f6cfd18d2da1d059548abf509bd71f200
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/quick/items/context2d/qquickcontext2dtexture_p.h')
-rw-r--r-- | src/quick/items/context2d/qquickcontext2dtexture_p.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index edc7283283..ed38382892 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -54,10 +54,10 @@ #include <QtQuick/qsgtexture.h> #include "qquickcanvasitem_p.h" #include "qquickcontext2d_p.h" - -#include <QOpenGLContext> -#include <QOpenGLFramebufferObject> - +#ifndef QT_NO_OPENGL +# include <QOpenGLContext> +# include <QOpenGLFramebufferObject> +#endif #include <QtCore/QMutex> #include <QtCore/QWaitCondition> #include <QtCore/QThread> @@ -121,11 +121,12 @@ public: // Called during sync() on the scene graph thread while GUI is blocked. virtual QSGTexture *textureForNextFrame(QSGTexture *lastFrame, QQuickWindow *window) = 0; bool event(QEvent *e); - +#ifndef QT_NO_OPENGL void initializeOpenGL(QOpenGLContext *gl, QOffscreenSurface *s) { m_gl = gl; m_surface = s; } +#endif Q_SIGNALS: void textureChanged(); @@ -152,8 +153,9 @@ protected: QList<QQuickContext2DTile*> m_tiles; QQuickContext2D *m_context; - +#ifndef QT_NO_OPENGL QOpenGLContext *m_gl; +#endif QSurface *m_surface; QQuickContext2D::State m_state; @@ -174,7 +176,7 @@ protected: uint m_painting : 1; uint m_onCustomThread : 1; // Not GUI and not SGRender }; - +#ifndef QT_NO_OPENGL class QQuickContext2DFBOTexture : public QQuickContext2DTexture { Q_OBJECT @@ -209,7 +211,7 @@ private: GLuint m_displayTextures[2]; int m_displayTexture; }; - +#endif class QSGPlainTexture; class QQuickContext2DImageTexture : public QQuickContext2DTexture { |