diff options
author | Andy Nichols <andy.nichols@qt.io> | 2016-11-08 16:02:01 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@qt.io> | 2016-11-17 14:59:47 +0000 |
commit | 1b905b3fa4955e26b39aaa51b0ca47e9c05e680b (patch) | |
tree | d17513037673b80299555034b9550a3c01b2eb8e /src/plugins/platforms/eglfs/api/qeglfsscreen.cpp | |
parent | e3ed95dd44b95b6e9361b562807e711d7ce5a58b (diff) |
Enable building EGLFS and MinimalEGL with QT_NO_OPENGL
It is possible to have support for EGL without having support for OpenGL
for example with OpenVG. Unfortanately many features of EGLFS require
OpenGL (Cursor, MultiWindow, QEGLPlatformContext, QBackingStore), so the
plugins become pretty useless on their own. This is necessary if you
still want to use Qt as a method to provide an EGL surface to render to
via QWindow. This is the method by which Qt Quick uses OpenVG to render
its content when available.
Change-Id: I34973b21bf1932865950ce6a78b71b3a29360d65
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/api/qeglfsscreen.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfsscreen.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp index 5613179041..d5c22b3d37 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp @@ -41,7 +41,9 @@ #include <QtGui/qwindow.h> #include <qpa/qwindowsysteminterface.h> #include <qpa/qplatformcursor.h> -#include <QtPlatformCompositorSupport/private/qopenglcompositor_p.h> +#ifndef QT_NO_OPENGL +# include <QtPlatformCompositorSupport/private/qopenglcompositor_p.h> +#endif #include "qeglfsscreen_p.h" #include "qeglfswindow_p.h" @@ -60,7 +62,9 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy) QEglFSScreen::~QEglFSScreen() { delete m_cursor; +#ifndef QT_NO_OPENGL QOpenGLCompositor::destroy(); +#endif } QRect QEglFSScreen::geometry() const @@ -145,6 +149,7 @@ void QEglFSScreen::setPrimarySurface(EGLSurface surface) void QEglFSScreen::handleCursorMove(const QPoint &pos) { +#ifndef QT_NO_OPENGL const QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); const QList<QOpenGLCompositorWindow *> windows = compositor->windows(); @@ -178,10 +183,12 @@ void QEglFSScreen::handleCursorMove(const QPoint &pos) if (enter && leave) QWindowSystemInterface::handleEnterLeaveEvent(enter, leave, enter->mapFromGlobal(pos), pos); +#endif } QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) const { +#ifndef QT_NO_OPENGL QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); const QList<QOpenGLCompositorWindow *> windows = compositor->windows(); Q_ASSERT(!windows.isEmpty()); @@ -224,7 +231,7 @@ QPixmap QEglFSScreen::grabWindow(WId wid, int x, int y, int width, int height) c return QPixmap::fromImage(img).copy(rect); } } - +#endif // QT_NO_OPENGL return QPixmap(); } |