#include <QtGui/QPlatformNativeInterface>
#include <QtGui/QGuiApplication>
#include <QtGui/QOpenGLContext>
+#include <QtGui/QPlatformScreen>
#define EGL_EGLEXT_PROTOTYPES
#include <EGL/egl.h>
#define GL_GLEXT_PROTOTYPES
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
+#include <QDebug>
GraphicsHardwareIntegration * GraphicsHardwareIntegration::createGraphicsHardwareIntegration(WaylandCompositor *compositor)
{
return textureId;
}
+
+bool WaylandEglIntegration::setDirectRenderSurface(WaylandSurface *)
+{
+ QPlatformScreen *screen = QPlatformScreen::platformScreenForWindow(m_compositor->window());
+ return screen && screen->pageFlipper();
+}
+
+
+bool WaylandEglIntegration::postBuffer(struct wl_buffer *buffer)
+{
+ QPlatformScreen *screen = QPlatformScreen::platformScreenForWindow(m_compositor->window());
+ QPlatformScreenPageFlipper *flipper = screen->pageFlipper();
+
+ return flipper ? flipper->displayBuffer(buffer) : false;
+}
GLuint createTextureFromBuffer(wl_buffer *buffer);
+ bool setDirectRenderSurface(WaylandSurface *);
+ bool postBuffer(struct wl_buffer *);
+
private:
Q_DISABLE_COPY(WaylandEglIntegration)
QScopedPointer<WaylandEglIntegrationPrivate> d_ptr;
setKeyFocus(0);
if (m_pointerFocusSurface == surface)
setPointerFocus(0);
+ if (m_directRenderSurface == surface)
+ setDirectRenderSurface(0);
}
void Compositor::markSurfaceAsDirty(Wayland::Surface *surface)
void attach(struct wl_buffer *buffer) {
bool emitMap = !surfaceBuffer;
- if (surfaceBuffer && ! textureCreatedForBuffer) {
+ if (surfaceBuffer && ! textureCreatedForBuffer && surfaceBuffer != directRenderBuffer) {
qWarning() << "### WaylandSurface::attach() releasing undisplayed buffer ###";
wl_client_post_event(client,&surfaceBuffer->resource.object,WL_BUFFER_RELEASE);
}
if (d->previousBuffer) {
wl_client_post_event(d->client,&d->previousBuffer->resource.object,WL_BUFFER_RELEASE);
}
- d->previousBuffer = d->buffer();
+ d->directRenderBuffer = d->previousBuffer = d->buffer();
return;
}
}
#endif
-
+ d->directRenderBuffer = 0;
d->compositor->markSurfaceAsDirty(this);
emit d->qtSurface->damaged(rect);