From d26ef66a660fb7d3e1cb94c863c4076a2ecd8199 Mon Sep 17 00:00:00 2001 From: Donald Carr Date: Tue, 6 Mar 2012 22:35:30 +0000 Subject: Remove widgets dependency from eglfs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit eglfs uses the (old) OpenGL paint engine for paint operations. This drags in a QWidget dependency and hence everything bar the kitchen sink. This change gets eglfs buildable without widget support although anything which relies on a QPaintDevice will end up rendering nothing to the screen. (Similar to the QWS simplegl driver) Change-Id: If7fcdb79038ef7568e771402fd1667bc0318ff5f Reviewed-by: Jørgen Lind Reviewed-by: Girish Ramakrishnan --- src/plugins/platforms/eglfs/qeglfsbackingstore.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/plugins/platforms/eglfs/qeglfsbackingstore.cpp') diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp index 331b768a93..d2e4a47e56 100644 --- a/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp +++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.cpp @@ -39,17 +39,19 @@ ** ****************************************************************************/ -#include - #include "qeglfsbackingstore.h" +#ifndef QT_NO_WIDGETS +#include +#include +#endif //QT_NO_WIDGETS + #include #include -#include - QT_BEGIN_NAMESPACE +#ifndef QT_NO_WIDGETS class QEglFSPaintDevice : public QGLPaintDevice { public: @@ -73,15 +75,20 @@ private: QEglFSScreen *m_screen; QGLContext *m_context; }; - +#endif //QT_NO_WIDGETS QEglFSBackingStore::QEglFSBackingStore(QWindow *window) - : QPlatformBackingStore(window) + : QPlatformBackingStore(window), + m_paintDevice(0) { #ifdef QEGL_EXTRA_DEBUG qWarning("QEglBackingStore %p, %p", window, window->screen()); #endif +#ifdef QT_NO_WIDGETS + m_paintDevice = new QImage(0,0); +#else m_paintDevice = new QEglFSPaintDevice(static_cast(window->screen()->handle())); +#endif //QT_NO_WIDGETS } void QEglFSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) @@ -92,7 +99,9 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPo #ifdef QEGL_EXTRA_DEBUG qWarning("QEglBackingStore::flush %p", window); #endif +#ifndef QT_NO_WIDGETS static_cast(m_paintDevice)->context()->swapBuffers(); +#endif //QT_NO_WIDGETS } void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents) -- cgit v1.2.3