From 1b905b3fa4955e26b39aaa51b0ca47e9c05e680b Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Tue, 8 Nov 2016 16:02:01 +0100 Subject: 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 --- src/plugins/platforms/eglfs/api/qeglfsscreen.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms/eglfs/api/qeglfsscreen.cpp') 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 #include #include -#include +#ifndef QT_NO_OPENGL +# include +#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 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 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(); } -- cgit v1.2.3