#CONFIG += wayland_gl
#CONFIG += mesa_egl
#CONFIG += dri2_xcb
+#CONFIG += xcomposite_glx
# comment out the following to not use pkg-config in the pri files
CONFIG += use_pkgconfig
DESTDIR=$$PWD/../../bin/
-QT += opengl
-
include (../../src/qt-compositor/qt-compositor.pri)
# Input
qmlRegisterType<WaylandSurfaceItem>("WaylandCompositor", 1, 0, "WaylandSurfaceItem");
qRegisterMetaType<WaylandSurface*>("WaylandSurface*");
#endif
+ m_compositor->initializeHardwareIntegration();
}
WaylandCompositor::~WaylandCompositor()
#include <QRect>
#ifdef QT_COMPOSITOR_WAYLAND_GL
-#define GL_GLEXT_PROTOTYPES
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
+#include <QtOpenGL/QGLContext>
#endif
class QWidget;
SOURCES += \
$$PWD/graphicshardwareintegration.cpp
-wayland_gl {
- mesa_egl {
- include (mesa_egl/mesa_egl.pri)
- DEFINES += QT_COMPOSITOR_MESA_EGL
- }
+wayland_gl{
+ contains(QT_CONFIG, opengl) {
+ DEFINES += QT_WAYLAND_GL_SUPPORT
+ QT += opengl
- dri2_xcb {
- include (dri2_xcb/dri2_xcb.pri)
- DEFINES += QT_COMPOSITOR_DRI2_XCB
+ contains(QT_CONFIG, opengles2) {
+ mesa_egl {
+ include (mesa_egl/mesa_egl.pri)
+ DEFINES += QT_COMPOSITOR_MESA_EGL
+ }
+ dri2_xcb {
+ include (dri2_xcb/dri2_xcb.pri)
+ DEFINES += QT_COMPOSITOR_DRI2_XCB
+ }
+ } else {
+ xcomposite_glx {
+ include (xcomposite_glx/xcomposite_glx.pri)
+ }
+ }
}
}
--- /dev/null
+include (../xcomposite_share/xcomposite_share.pri)
+
+LIBS += -lXcomposite
+
+HEADERS += \
+ $$PWD/xcompositeglxintegration.h
+
+SOURCES += \
+ $$PWD/xcompositeglxintegration.cpp
--- /dev/null
+#include "xcompositeglxintegration.h"
+
+#include "waylandobject.h"
+#include "wayland_wrapper/wlcompositor.h"
+#include "wayland-xcomposite-server-protocol.h"
+
+#include <QtGui/QPlatformNativeInterface>
+#include <QtGui/QPlatformGLContext>
+#include <private/qapplication_p.h>
+
+#include "xcompositebuffer.h"
+#include "xcompositehandler.h"
+#include <X11/extensions/Xcomposite.h>
+
+#include <QtCore/QDebug>
+
+QVector<int> qglx_buildSpec()
+{
+ QVector<int> spec(48);
+ int i = 0;
+
+ spec[i++] = GLX_LEVEL;
+ spec[i++] = 0;
+ spec[i++] = GLX_DRAWABLE_TYPE; spec[i++] = GLX_PIXMAP_BIT;
+ spec[i++] = GLX_BIND_TO_TEXTURE_TARGETS_EXT; spec[i++] = GLX_TEXTURE_2D_BIT_EXT;
+ spec[i++] = GLX_BIND_TO_TEXTURE_RGB_EXT; spec[i++] = TRUE;
+
+ spec[i++] = 0;
+ return spec;
+}
+
+
+struct wl_xcomposite_interface XCompositeHandler::xcomposite_interface = {
+ XCompositeHandler::create_buffer
+};
+
+GraphicsHardwareIntegration *GraphicsHardwareIntegration::createGraphicsHardwareIntegration(WaylandCompositor *compositor)
+{
+ return new XCompositeGLXIntegration(compositor);
+}
+
+XCompositeGLXIntegration::XCompositeGLXIntegration(WaylandCompositor *compositor)
+ : GraphicsHardwareIntegration(compositor)
+ , mDisplay(0)
+{
+ QPlatformNativeInterface *nativeInterface = QApplicationPrivate::platformIntegration()->nativeInterface();
+ if (nativeInterface) {
+ mDisplay = static_cast<Display *>(nativeInterface->nativeResourceForWidget("Display",m_compositor->topLevelWidget()));
+ if (!mDisplay)
+ qFatal("could not retireve Display from platform integration");
+ } else {
+ qFatal("Platform integration doesn't have native interface");
+ }
+ mScreen = XDefaultScreen(mDisplay);
+}
+
+void XCompositeGLXIntegration::initializeHardware(Wayland::Display *waylandDisplay)
+{
+ XCompositeHandler *handler = new XCompositeHandler(m_compositor->handle(),mDisplay,m_compositor->topLevelWidget());
+ waylandDisplay->addGlobalObject(handler->base(), &wl_xcomposite_interface, &XCompositeHandler::xcomposite_interface,XCompositeHandler::send_root_information);
+
+ QPlatformGLContext *glContext = m_compositor->topLevelWidget()->platformWindow()->glContext();
+
+ m_glxBindTexImageEXT = reinterpret_cast<PFNGLXBINDTEXIMAGEEXTPROC>(glContext->getProcAddress("glXBindTexImageEXT"));
+ if (!m_glxBindTexImageEXT) {
+ qDebug() << "Did not find glxBindTexImageExt, everything will FAIL!";
+ }
+ m_glxReleaseTexImageEXT = reinterpret_cast<PFNGLXRELEASETEXIMAGEEXTPROC>(glContext->getProcAddress("glXReleaseTexImageEXT"));
+ if (!m_glxReleaseTexImageEXT) {
+ qDebug() << "Did not find glxReleaseTexImageExt";
+ }
+}
+
+GLuint XCompositeGLXIntegration::createTextureFromBuffer(wl_buffer *buffer)
+{
+ XCompositeBuffer *compositorBuffer = Wayland::wayland_cast<XCompositeBuffer *>(buffer);
+ Pixmap pixmap = XCompositeNameWindowPixmap(mDisplay, compositorBuffer->window());
+
+ QVector<int> glxConfigSpec = qglx_buildSpec();
+ int numberOfConfigs;
+ GLXFBConfig *configs = glXChooseFBConfig(mDisplay,mScreen,glxConfigSpec.constData(),&numberOfConfigs);
+
+ QVector<int> attribList;
+ attribList.append(GLX_TEXTURE_FORMAT_EXT);
+ attribList.append(GLX_TEXTURE_FORMAT_RGB_EXT);
+ attribList.append(GLX_TEXTURE_TARGET_EXT);
+ attribList.append(GLX_TEXTURE_2D_EXT);
+ attribList.append(0);
+ GLXPixmap glxPixmap = glXCreatePixmap(mDisplay,*configs,pixmap,attribList.constData());
+ XFree(configs);
+
+ GLuint textureId;
+ glGenTextures(1,&textureId);
+ glBindTexture(GL_TEXTURE_2D, textureId);
+ m_glxBindTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT, 0);
+ //Do we need to change the api so that we do bind and release in the painevent?
+ //The specification states that when deleting the texture the color buffer is deleted
+// m_glxReleaseTexImageEXT(mDisplay,glxPixmap,GLX_FRONT_EXT);
+ return textureId;
+}
--- /dev/null
+#ifndef XCOMPOSITEGLXINTEGRATION_H
+#define XCOMPOSITEGLXINTEGRATION_H
+
+#include "hardware_integration/graphicshardwareintegration.h"
+
+#include "xlibinclude.h"
+
+#define GLX_GLXEXT_PROTOTYPES
+#include <GL/glx.h>
+#include <GL/glxext.h>
+
+class XCompositeGLXIntegration : public GraphicsHardwareIntegration
+{
+public:
+ XCompositeGLXIntegration(WaylandCompositor *compositor);
+
+ void initializeHardware(Wayland::Display *waylandDisplay);
+
+ GLuint createTextureFromBuffer(struct wl_buffer *buffer);
+
+private:
+ PFNGLXBINDTEXIMAGEEXTPROC m_glxBindTexImageEXT;
+ PFNGLXRELEASETEXIMAGEEXTPROC m_glxReleaseTexImageEXT;
+
+ Display *mDisplay;
+ int mScreen;
+};
+
+#endif // XCOMPOSITEGLXINTEGRATION_H
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="xcomposite">
+ <!-- XComposite support. This object is created by the server and published
+ using the display's global event. -->
+ <interface name="xcomposite" version="1">
+
+ <!-- Create a wayland buffer for X Window. -->
+ <request name="create_buffer">
+ <arg name="id" type="new_id" interface="buffer"/>
+ <arg name="x_window" type="uint"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="visual" type="object" interface="visual"/>
+ </request>
+
+ <!-- Notification of the root window to use for the X Window created
+ on the client side. Also passes in the Display name to use -->
+ <event name="root">
+ <arg name="display_name" type="string"/>
+ <arg name="root_window" type="uint"/>
+ </event>
+
+ </interface>
+
+</protocol>
--- /dev/null
+/*
+ * Copyright © 2010 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifndef XCOMPOSITE_CLIENT_PROTOCOL_H
+#define XCOMPOSITE_CLIENT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-util.h"
+
+struct wl_client;
+
+struct wl_xcomposite;
+
+struct wl_proxy;
+
+extern void
+wl_proxy_marshal(struct wl_proxy *p, uint32_t opcode, ...);
+extern struct wl_proxy *
+wl_proxy_create(struct wl_proxy *factory,
+ const struct wl_interface *interface);
+extern struct wl_proxy *
+wl_proxy_create_for_id(struct wl_display *display,
+ const struct wl_interface *interface, uint32_t id);
+extern void
+wl_proxy_destroy(struct wl_proxy *proxy);
+
+extern int
+wl_proxy_add_listener(struct wl_proxy *proxy,
+ void (**implementation)(void), void *data);
+
+extern void
+wl_proxy_set_user_data(struct wl_proxy *proxy, void *user_data);
+
+extern void *
+wl_proxy_get_user_data(struct wl_proxy *proxy);
+
+extern const struct wl_interface wl_xcomposite_interface;
+
+struct wl_xcomposite_listener {
+ void (*root)(void *data,
+ struct wl_xcomposite *xcomposite,
+ const char *display_name,
+ uint32_t root_window);
+};
+
+static inline int
+wl_xcomposite_add_listener(struct wl_xcomposite *xcomposite,
+ const struct wl_xcomposite_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) xcomposite,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_XCOMPOSITE_CREATE_BUFFER 0
+
+static inline struct wl_xcomposite *
+wl_xcomposite_create(struct wl_display *display, uint32_t id)
+{
+ return (struct wl_xcomposite *)
+ wl_proxy_create_for_id(display, &wl_xcomposite_interface, id);
+}
+
+static inline void
+wl_xcomposite_set_user_data(struct wl_xcomposite *xcomposite, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) xcomposite, user_data);
+}
+
+static inline void *
+wl_xcomposite_get_user_data(struct wl_xcomposite *xcomposite)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) xcomposite);
+}
+
+static inline void
+wl_xcomposite_destroy(struct wl_xcomposite *xcomposite)
+{
+ wl_proxy_destroy((struct wl_proxy *) xcomposite);
+}
+
+static inline struct wl_buffer *
+wl_xcomposite_create_buffer(struct wl_xcomposite *xcomposite, uint32_t x_window, int width, int height, struct wl_visual *visual)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_create((struct wl_proxy *) xcomposite,
+ &wl_buffer_interface);
+ if (!id)
+ return NULL;
+
+ wl_proxy_marshal((struct wl_proxy *) xcomposite,
+ WL_XCOMPOSITE_CREATE_BUFFER, id, x_window, width, height, visual);
+
+ return (struct wl_buffer *) id;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+/*
+ * Copyright © 2010 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+static const struct wl_message xcomposite_requests[] = {
+ { "create_buffer", "nuiio" },
+};
+
+static const struct wl_message xcomposite_events[] = {
+ { "root", "su" },
+};
+
+WL_EXPORT const struct wl_interface wl_xcomposite_interface = {
+ "xcomposite", 1,
+ ARRAY_LENGTH(xcomposite_requests), xcomposite_requests,
+ ARRAY_LENGTH(xcomposite_events), xcomposite_events,
+};
+
--- /dev/null
+/*
+ * Copyright © 2010 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that copyright
+ * notice and this permission notice appear in supporting documentation, and
+ * that the name of the copyright holders not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. The copyright holders make no representations
+ * about the suitability of this software for any purpose. It is provided "as
+ * is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
+ * OF THIS SOFTWARE.
+ */
+
+
+#ifndef XCOMPOSITE_SERVER_PROTOCOL_H
+#define XCOMPOSITE_SERVER_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-util.h"
+
+struct wl_client;
+
+struct wl_xcomposite;
+
+extern const struct wl_interface wl_xcomposite_interface;
+
+struct wl_xcomposite_interface {
+ void (*create_buffer)(struct wl_client *client,
+ struct wl_xcomposite *xcomposite,
+ uint32_t id,
+ uint32_t x_window,
+ int width,
+ int height,
+ struct wl_visual *visual);
+};
+
+#define WL_XCOMPOSITE_ROOT 0
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
--- /dev/null
+INCLUDEPATH += $$PWD
+
+HEADERS += \
+ $$PWD/wayland-xcomposite-server-protocol.h \
+ $$PWD/xcompositebuffer.h \
+ $$PWD/xcompositehandler.h \
+ $$PWD/xlibinclude.h
+
+SOURCES += \
+ $$PWD/wayland-xcomposite-protocol.c \
+ $$PWD/xcompositebuffer.cpp \
+ $$PWD/xcompositehandler.cpp
--- /dev/null
+#include "xcompositebuffer.h"
+
+XCompositeBuffer::XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size, struct wl_visual *visual)
+ : mWindow(window)
+{
+ base()->attach = 0;
+ base()->damage = 0;
+ base()->compositor = compositor->base();
+ base()->height = size.height();
+ base()->width = size.width();
+ base()->visual = visual;
+}
+
+struct wl_buffer_interface XCompositeBuffer::buffer_interface = {
+ XCompositeBuffer::buffer_interface_destroy
+};
+
+void XCompositeBuffer::buffer_interface_destroy(wl_client *client, wl_buffer *buffer)
+{
+ Q_UNUSED(client);
+ Q_UNUSED(buffer);
+}
+
+void XCompositeBuffer::delete_resource(struct wl_resource *resource,
+ struct wl_client *client)
+{
+ Q_UNUSED(client);
+ delete reinterpret_cast<XCompositeBuffer *>(resource);
+}
+
+Window XCompositeBuffer::window()
+{
+ return mWindow;
+}
--- /dev/null
+#ifndef XCOMPOSITEBUFFER_H
+#define XCOMPOSITEBUFFER_H
+
+#include "waylandobject.h"
+#include "wayland_wrapper/wlcompositor.h"
+
+#include <QtCore/QSize>
+
+#include <QtCore/QTextStream>
+#include <QtCore/QDataStream>
+#include <QtCore/QMetaType>
+#include <QtCore/QVariant>
+#include <QtGui/QWidget>
+
+#include <X11/X.h>
+
+class XCompositeBuffer : public Wayland::Object<struct wl_buffer>
+{
+public:
+ XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size, struct wl_visual *visual);
+
+ Window window();
+
+ static struct wl_buffer_interface buffer_interface;
+ static void delete_resource(struct wl_resource *resource,
+ struct wl_client *client);
+private:
+ Window mWindow;
+
+ static void buffer_interface_destroy(struct wl_client *client,
+ struct wl_buffer *buffer);
+};
+
+#endif // XCOMPOSITORBUFFER_H
--- /dev/null
+#include "xcompositehandler.h"
+
+#include "wayland-xcomposite-server-protocol.h"
+
+#include "xcompositebuffer.h"
+#include <X11/extensions/Xcomposite.h>
+
+XCompositeHandler::XCompositeHandler(Wayland::Compositor *compositor, Display *display, QWidget *topLevelWidget)
+ : mCompositor(compositor)
+ , mTopLevelWidget(topLevelWidget)
+ , mDisplay(display)
+{
+ mFakeRootWidget = new QWidget(mCompositor->topLevelWidget());
+ mFakeRootWidget->setGeometry(-1,-1,1,1);
+ mFakeRootWidget->setAttribute(Qt::WA_NativeWindow);
+ int composite_event_base, composite_error_base;
+ if (XCompositeQueryExtension(mDisplay, &composite_event_base, &composite_error_base)) {
+
+ } else {
+ qFatal("XComposite required");
+ }
+}
+
+void XCompositeHandler::createBuffer(struct wl_client *client, uint32_t id, Window window, const QSize &size, struct wl_visual *visual)
+{
+ XCompositeBuffer *buffer = new XCompositeBuffer(mCompositor, window, size, visual);
+ Wayland::addClientResource(client,&buffer->base()->resource,
+ id,&wl_buffer_interface,
+ &XCompositeBuffer::buffer_interface,
+ XCompositeBuffer::delete_resource);
+}
+
+void XCompositeHandler::send_root_information(struct wl_client *client, struct wl_object *global)
+{
+ XCompositeHandler *handler = Wayland::wayland_cast<XCompositeHandler *>(global);
+ const char *displayString = XDisplayString(handler->mDisplay);
+ wl_client_post_event(client, global, WL_XCOMPOSITE_ROOT, displayString, handler->mFakeRootWidget->winId());
+}
+
+void XCompositeHandler::create_buffer(struct wl_client *client,
+ struct wl_xcomposite *xcomposite,
+ uint32_t id,
+ uint32_t x_window,
+ int width,
+ int height,
+ struct wl_visual *visual)
+{
+ Window window = (Window)x_window;
+ XCompositeHandler *that = reinterpret_cast<XCompositeHandler *>(xcomposite);
+ that->createBuffer(client, id, window, QSize(width,height),visual);
+}
--- /dev/null
+#ifndef XCOMPOSITEHANDLER_H
+#define XCOMPOSITEHANDLER_H
+
+#include "wayland_wrapper/wlcompositor.h"
+
+#include "xlibinclude.h"
+
+class XCompositeHandler : public Wayland::Object<struct wl_object>
+{
+public:
+ XCompositeHandler(Wayland::Compositor *compositor, Display *display, QWidget *topLevelWidget);
+ void createBuffer(struct wl_client *client, uint32_t id, Window window, const QSize &size, struct wl_visual *visual);
+
+ static void send_root_information(struct wl_client *client, struct wl_object *global);
+ static struct wl_xcomposite_interface xcomposite_interface;
+
+private:
+ Wayland::Compositor *mCompositor;
+ QWidget *mTopLevelWidget;
+ QWidget *mFakeRootWidget;
+ Display *mDisplay;
+
+ static void create_buffer(struct wl_client *client,
+ struct wl_xcomposite *xcomposite,
+ uint32_t id,
+ uint32_t x_window,
+ int width,
+ int height,
+ struct wl_visual *visual);
+
+};
+
+#endif // XCOMPOSITEHANDLER_H
--- /dev/null
+#include <QtCore/QEvent>
+#include <QtCore/QTextStream>
+#include <QtCore/QDataStream>
+#include <QtCore/QMetaType>
+#include <QtCore/QVariant>
+#include <QtGui/QCursor>
+
+#include <X11/Xlib.h>
exit(EXIT_FAILURE);
}
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- m_graphics_hw_integration->initializeHardware(m_display);
-#endif //QT_COMPOSITOR_WAYLAND_GL
-
m_loop = wl_display_get_event_loop(m_display->handle());
int fd = wl_event_loop_get_fd(m_loop);
return m_qt_compositor->topLevelWidget();
}
-#ifdef QT_COMPOSITOR_WAYLAND_GL
GraphicsHardwareIntegration * Compositor::graphicsHWIntegration() const
{
+#ifdef QT_COMPOSITOR_WAYLAND_GL
return m_graphics_hw_integration;
+#else
+ return 0;
+#endif
}
+
+void Compositor::initializeHardwareIntegration()
+{
+#ifdef QT_COMPOSITOR_WAYLAND_GL
+ m_graphics_hw_integration->initializeHardware(m_display);
#endif
+}
+
}
uint currentTimeMsecs() const;
QWidget *topLevelWidget() const;
-#ifdef QT_COMPOSITOR_WAYLAND_GL
+
GraphicsHardwareIntegration *graphicsHWIntegration() const;
-#endif
+ void initializeHardwareIntegration();
wl_input_device *defaultInputDevice();
private slots:
#include <QtGui/private/qapplication_p.h>
#ifdef QT_COMPOSITOR_WAYLAND_GL
-#define GL_GLEXT_PROTOTYPES
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
+#include <QtOpenGL/QGLContext>
#endif
namespace Wayland {