summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@nokia.com>2011-02-24 16:31:15 (GMT)
committerPaul Olav Tvete <paul.tvete@nokia.com>2011-02-24 16:32:53 (GMT)
commit1f50a3aa50b934a181cd0d18c260f2533ab63d43 (patch)
tree3b2a38b97a3547b52d820068e06bb3b5668594e7 /src/plugins
parent87c16f2bedaf1810cf9a96f65e5af0ad819bf9e5 (diff)
downloadQt-1f50a3aa50b934a181cd0d18c260f2533ab63d43.zip
Qt-1f50a3aa50b934a181cd0d18c260f2533ab63d43.tar.gz
Qt-1f50a3aa50b934a181cd0d18c260f2533ab63d43.tar.bz2
Make it build when EGL is not available
Reviewed-by: Jørgen
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/wayland/qwaylanddisplay.cpp12
-rw-r--r--src/plugins/platforms/wayland/qwaylandinclude.h6
-rw-r--r--src/plugins/platforms/wayland/qwaylandintegration.cpp4
-rw-r--r--src/plugins/platforms/wayland/wayland.pro24
4 files changed, 37 insertions, 9 deletions
diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
index ca23165..c3e87a1 100644
--- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp
@@ -171,8 +171,9 @@ void QWaylandDisplay::flushRequests(void)
QWaylandDisplay::QWaylandDisplay(void)
: mWriteNotifier(0)
{
+#ifdef QT_WAYLAND_GL_SUPPORT
EGLint major, minor;
-
+#endif
mDisplay = wl_display_connect(NULL);
if (mDisplay == NULL) {
fprintf(stderr, "failed to create display: %m\n");
@@ -182,6 +183,7 @@ QWaylandDisplay::QWaylandDisplay(void)
wl_display_add_global_listener(mDisplay,
QWaylandDisplay::displayHandleGlobal, this);
+#ifdef QT_WAYLAND_GL_SUPPORT
mNativeEglDisplay = wl_egl_display_create(mDisplay);
mEglDisplay = eglGetDisplay((EGLNativeDisplayType)mNativeEglDisplay);
@@ -193,6 +195,12 @@ QWaylandDisplay::QWaylandDisplay(void)
return;
}
}
+#else
+ mNativeEglDisplay = 0;
+ mEglDisplay = 0;
+#endif
+
+ eventDispatcher();
int fd = wl_display_get_fd(mDisplay, sourceUpdate, this);
mReadNotifier = new QSocketNotifier(fd, QSocketNotifier::Read, this);
@@ -208,7 +216,9 @@ QWaylandDisplay::QWaylandDisplay(void)
QWaylandDisplay::~QWaylandDisplay(void)
{
close(mFd);
+#ifdef QT_WAYLAND_GL_SUPPORT
eglTerminate(mEglDisplay);
+#endif
wl_display_destroy(mDisplay);
}
diff --git a/src/plugins/platforms/wayland/qwaylandinclude.h b/src/plugins/platforms/wayland/qwaylandinclude.h
index afaa885..0135251 100644
--- a/src/plugins/platforms/wayland/qwaylandinclude.h
+++ b/src/plugins/platforms/wayland/qwaylandinclude.h
@@ -44,6 +44,7 @@
#include <wayland-client.h>
+#ifdef QT_WAYLAND_GL_SUPPORT
#include <wayland-egl.h>
#define GL_GLEXT_PROTOTYPES
@@ -54,4 +55,9 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
+#else
+typedef void* EGLDisplay;
+typedef void* EGLConfig;
+#endif
+
#endif // QWAYLANDINCLUDE_H
diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp
index 9483a47..7c0f69e 100644
--- a/src/plugins/platforms/wayland/qwaylandintegration.cpp
+++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp
@@ -54,7 +54,9 @@
#include <QtGui/QPlatformWindowFormat>
#include <QtGui/private/qpixmap_raster_p.h>
+#ifdef QT_WAYLAND_GL_SUPPORT
#include <QtOpenGL/private/qpixmapdata_gl_p.h>
+#endif
QWaylandIntegration::QWaylandIntegration(bool useOpenGL)
: mFontDb(new QFontconfigDatabase())
@@ -71,8 +73,10 @@ QWaylandIntegration::screens() const
QPixmapData *QWaylandIntegration::createPixmapData(QPixmapData::PixelType type) const
{
+#ifdef QT_WAYLAND_GL_SUPPORT
if (mUseOpenGL)
return new QGLPixmapData(type);
+#endif
return new QRasterPixmapData(type);
}
diff --git a/src/plugins/platforms/wayland/wayland.pro b/src/plugins/platforms/wayland/wayland.pro
index e40e423..9faa59b 100644
--- a/src/plugins/platforms/wayland/wayland.pro
+++ b/src/plugins/platforms/wayland/wayland.pro
@@ -8,15 +8,11 @@ DEFINES += Q_PLATFORM_WAYLAND
SOURCES = main.cpp \
qwaylandintegration.cpp \
qwaylandshmsurface.cpp \
- qwaylanddrmsurface.cpp \
qwaylandinputdevice.cpp \
- qwaylandglcontext.cpp \
qwaylandcursor.cpp \
qwaylanddisplay.cpp \
qwaylandwindow.cpp \
qwaylandscreen.cpp \
- ../eglconvenience/qeglconvenience.cpp \
- qwaylandeglwindow.cpp \
qwaylandshmwindow.cpp
HEADERS = qwaylandintegration.h \
@@ -24,19 +20,31 @@ HEADERS = qwaylandintegration.h \
qwaylanddisplay.h \
qwaylandwindow.h \
qwaylandscreen.h \
- qwaylandglcontext.h \
qwaylandshmsurface.h \
qwaylanddrmsurface.h \
qwaylandbuffer.h \
- ../eglconvenience/qeglconvenience.h \
qwaylandinclude.h \
qwaylandeglwindow.h \
qwaylandshmwindow.h
-contains(QT_CONFIG, opengl) {
+LIBS += -lwayland-client
+LIBS += -lxkbcommon
+
+contains(QT_CONFIG, opengles2) {
QT += opengl
+ LIBS += -lwayland-egl -lEGL
+
+ SOURCES += qwaylanddrmsurface.cpp \
+ qwaylandglcontext.cpp \
+ ../eglconvenience/qeglconvenience.cpp \
+ qwaylandeglwindow.cpp
+
+ HEADERS += qwaylandglcontext.h \
+ ../eglconvenience/qeglconvenience.h \
+
+ DEFINES += QT_WAYLAND_GL_SUPPORT
}
-LIBS += -lwayland-client -lwayland-egl -lxkbcommon -lEGL
+
unix {
CONFIG += link_pkgconfig
PKGCONFIG += libdrm