Restoring QT_WAYLAND_GL_SUPPORT ifdefs.

This commit is contained in:
Laszlo Agocs 2011-06-20 12:21:29 +02:00
parent 83130d791d
commit 672fe5d43c
3 changed files with 28 additions and 1 deletions

View File

@ -47,7 +47,9 @@
#include "qwaylandinputdevice.h" #include "qwaylandinputdevice.h"
#include "qwaylandclipboard.h" #include "qwaylandclipboard.h"
#ifdef QT_WAYLAND_GL_SUPPORT
#include "gl_integration/qwaylandglintegration.h" #include "gl_integration/qwaylandglintegration.h"
#endif
#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
#include "windowmanager_integration/qwaylandwindowmanagerintegration.h" #include "windowmanager_integration/qwaylandwindowmanagerintegration.h"
@ -91,10 +93,12 @@ struct wl_visual *QWaylandDisplay::argbPremultipliedVisual()
return premultiplied_argb_visual; return premultiplied_argb_visual;
} }
#ifdef QT_WAYLAND_GL_SUPPORT
QWaylandGLIntegration * QWaylandDisplay::eglIntegration() QWaylandGLIntegration * QWaylandDisplay::eglIntegration()
{ {
return mEglIntegration; return mEglIntegration;
} }
#endif
#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration() QWaylandWindowManagerIntegration *QWaylandDisplay::windowManagerIntegration()
@ -132,7 +136,9 @@ QWaylandDisplay::QWaylandDisplay(void)
wl_display_add_global_listener(mDisplay, QWaylandDisplay::displayHandleGlobal, this); wl_display_add_global_listener(mDisplay, QWaylandDisplay::displayHandleGlobal, this);
#ifdef QT_WAYLAND_GL_SUPPORT
mEglIntegration = QWaylandGLIntegration::createGLIntegration(this); mEglIntegration = QWaylandGLIntegration::createGLIntegration(this);
#endif
#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
mWindowManagerIntegration = QWaylandWindowManagerIntegration::createIntegration(this); mWindowManagerIntegration = QWaylandWindowManagerIntegration::createIntegration(this);
@ -142,7 +148,9 @@ QWaylandDisplay::QWaylandDisplay(void)
qRegisterMetaType<uint32_t>("uint32_t"); qRegisterMetaType<uint32_t>("uint32_t");
#ifdef QT_WAYLAND_GL_SUPPORT
mEglIntegration->initialize(); mEglIntegration->initialize();
#endif
connect(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()), this, SLOT(flushRequests())); connect(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
@ -157,7 +165,9 @@ QWaylandDisplay::QWaylandDisplay(void)
QWaylandDisplay::~QWaylandDisplay(void) QWaylandDisplay::~QWaylandDisplay(void)
{ {
close(mFd); close(mFd);
#ifdef QT_WAYLAND_GL_SUPPORT
delete mEglIntegration; delete mEglIntegration;
#endif
wl_display_destroy(mDisplay); wl_display_destroy(mDisplay);
} }

View File

@ -73,7 +73,9 @@ public:
struct wl_visual *argbVisual(); struct wl_visual *argbVisual();
struct wl_visual *argbPremultipliedVisual(); struct wl_visual *argbPremultipliedVisual();
#ifdef QT_WAYLAND_GL_SUPPORT
QWaylandGLIntegration *eglIntegration(); QWaylandGLIntegration *eglIntegration();
#endif
#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
QWaylandWindowManagerIntegration *windowManagerIntegration(); QWaylandWindowManagerIntegration *windowManagerIntegration();
@ -132,7 +134,9 @@ private:
struct wl_compositor *compositor, struct wl_compositor *compositor,
uint32_t id, uint32_t token); uint32_t id, uint32_t token);
#ifdef QT_WAYLAND_GL_SUPPORT
QWaylandGLIntegration *mEglIntegration; QWaylandGLIntegration *mEglIntegration;
#endif
#ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT #ifdef QT_WAYLAND_WINDOWMANAGER_SUPPORT
QWaylandWindowManagerIntegration *mWindowManagerIntegration; QWaylandWindowManagerIntegration *mWindowManagerIntegration;

View File

@ -55,7 +55,9 @@
#include <QtGui/private/qpixmap_raster_p.h> #include <QtGui/private/qpixmap_raster_p.h>
#ifdef QT_WAYLAND_GL_SUPPORT
#include "gl_integration/qwaylandglintegration.h" #include "gl_integration/qwaylandglintegration.h"
#endif
QWaylandIntegration::QWaylandIntegration() QWaylandIntegration::QWaylandIntegration()
: mFontDb(new QGenericUnixFontDatabase()) : mFontDb(new QGenericUnixFontDatabase())
@ -80,7 +82,12 @@ bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) co
{ {
switch (cap) { switch (cap) {
case ThreadedPixmaps: return true; case ThreadedPixmaps: return true;
case OpenGL: return true; case OpenGL:
#ifdef QT_WAYLAND_GL_SUPPORT
return true;
#else
return false;
#endif
default: return QPlatformIntegration::hasCapability(cap); default: return QPlatformIntegration::hasCapability(cap);
} }
} }
@ -92,15 +99,21 @@ QPixmapData *QWaylandIntegration::createPixmapData(QPixmapData::PixelType type)
QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const
{ {
#ifdef QT_WAYLAND_GL_SUPPORT
if (window->surfaceType() == QWindow::OpenGLSurface) if (window->surfaceType() == QWindow::OpenGLSurface)
return mDisplay->eglIntegration()->createEglWindow(window); return mDisplay->eglIntegration()->createEglWindow(window);
#endif
return new QWaylandShmWindow(window); return new QWaylandShmWindow(window);
} }
QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QGuiGLFormat &glFormat, QPlatformGLContext *share) const
{ {
#ifdef QT_WAYLAND_GL_SUPPORT
return mDisplay->eglIntegration()->createPlatformGLContext(glFormat, share); return mDisplay->eglIntegration()->createPlatformGLContext(glFormat, share);
#else
return 0;
#endif
} }
QWindowSurface *QWaylandIntegration::createWindowSurface(QWindow *window, WId winId) const QWindowSurface *QWaylandIntegration::createWindowSurface(QWindow *window, WId winId) const