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

View File

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

View File

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