summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Carr <donald.carr@nokia.com>2012-03-06 22:35:30 +0000
committerQt by Nokia <qt-info@nokia.com>2012-03-09 01:42:05 +0100
commitd26ef66a660fb7d3e1cb94c863c4076a2ecd8199 (patch)
tree8037705baf4edc3f31538606b37698bff1ffe761
parent5434295389caf821d39adceb2b34c1a18e8d1403 (diff)
Remove widgets dependency from eglfs
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 <jorgen.lind@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
-rw-r--r--src/plugins/platforms/eglfs/eglfs.pro6
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.cpp21
-rw-r--r--src/plugins/platforms/eglfs/qeglfsbackingstore.h2
3 files changed, 21 insertions, 8 deletions
diff --git a/src/plugins/platforms/eglfs/eglfs.pro b/src/plugins/platforms/eglfs/eglfs.pro
index 8675dc164e..291e09d6ed 100644
--- a/src/plugins/platforms/eglfs/eglfs.pro
+++ b/src/plugins/platforms/eglfs/eglfs.pro
@@ -2,7 +2,11 @@ TARGET = qeglfs
TEMPLATE = lib
CONFIG += plugin
-QT += opengl core-private gui-private opengl-private platformsupport-private widgets-private
+QT += core-private gui-private platformsupport-private
+
+!contains(QT_CONFIG, no-widgets) {
+ QT += opengl opengl-private widgets-private
+}
DESTDIR = $$QT.gui.plugins/platforms
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 <QtOpenGL/private/qgl_p.h>
-
#include "qeglfsbackingstore.h"
+#ifndef QT_NO_WIDGETS
+#include <QtOpenGL/private/qgl_p.h>
+#include <QtOpenGL/private/qglpaintdevice_p.h>
+#endif //QT_NO_WIDGETS
+
#include <QtGui/QPlatformOpenGLContext>
#include <QtGui/QScreen>
-#include <QtOpenGL/private/qglpaintdevice_p.h>
-
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<QEglFSScreen *>(window->screen()->handle()));
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
@@ -92,7 +99,9 @@ void QEglFSBackingStore::flush(QWindow *window, const QRegion &region, const QPo
#ifdef QEGL_EXTRA_DEBUG
qWarning("QEglBackingStore::flush %p", window);
#endif
+#ifndef QT_NO_WIDGETS
static_cast<QEglFSPaintDevice *>(m_paintDevice)->context()->swapBuffers();
+#endif //QT_NO_WIDGETS
}
void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents)
diff --git a/src/plugins/platforms/eglfs/qeglfsbackingstore.h b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
index 5623a96004..1ae3ecdc61 100644
--- a/src/plugins/platforms/eglfs/qeglfsbackingstore.h
+++ b/src/plugins/platforms/eglfs/qeglfsbackingstore.h
@@ -53,7 +53,7 @@ class QEglFSBackingStore : public QPlatformBackingStore
{
public:
QEglFSBackingStore(QWindow *window);
- ~QEglFSBackingStore() {}
+ ~QEglFSBackingStore() { delete m_paintDevice; }
QPaintDevice *paintDevice() { return m_paintDevice; }
void flush(QWindow *window, const QRegion &region, const QPoint &offset);