summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-01-18 19:52:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-21 15:17:34 +0100
commit76d2f1e8ef87f998444ec0a6e3c68c77525cff19 (patch)
tree254ae9d733f3a91b6e76f0b14c104443609bfa3d
parent36ff0f303b79dcd7aae93d5a73dfc1f179ac5560 (diff)
downloadqtwayland-76d2f1e8ef87f998444ec0a6e3c68c77525cff19.tar.gz
qtwayland-76d2f1e8ef87f998444ec0a6e3c68c77525cff19.tar.bz2
qtwayland-76d2f1e8ef87f998444ec0a6e3c68c77525cff19.zip
Removed directrender/pageflipper codepaths.
Change-Id: I770b79eb21fbc4ac7826cec5c47286dab6c74da5 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Andy Nichols <andy.nichols@digia.com>
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.cpp11
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.h3
-rw-r--r--src/compositor/hardware_integration/qwaylandclientbufferintegration.h2
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor.cpp43
-rw-r--r--src/compositor/wayland_wrapper/qwlcompositor_p.h14
-rw-r--r--src/compositor/wayland_wrapper/qwlsurface.cpp6
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp26
-rw-r--r--src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h10
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp16
-rw-r--r--src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h2
10 files changed, 11 insertions, 122 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp
index 35e39dc4..be001a9c 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.cpp
+++ b/src/compositor/compositor_api/qwaylandcompositor.cpp
@@ -126,17 +126,6 @@ QList<QWaylandSurface *> QWaylandCompositor::surfacesForClient(WaylandClient* c)
return result;
}
-bool QWaylandCompositor::setDirectRenderSurface(QWaylandSurface *surface, QOpenGLContext *context)
-{
- return m_compositor->setDirectRenderSurface(surface ? surface->handle() : 0, context);
-}
-
-QWaylandSurface *QWaylandCompositor::directRenderSurface() const
-{
- QtWayland::Surface *surf = m_compositor->directRenderSurface();
- return surf ? surf->waylandSurface() : 0;
-}
-
QWindow * QWaylandCompositor::window() const
{
return m_toplevel_window;
diff --git a/src/compositor/compositor_api/qwaylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h
index 338992e0..639ddd6c 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.h
+++ b/src/compositor/compositor_api/qwaylandcompositor.h
@@ -91,9 +91,6 @@ public:
QList<QWaylandSurface *> surfacesForClient(WaylandClient* client) const;
- bool setDirectRenderSurface(QWaylandSurface *surface, QOpenGLContext *context);
- QWaylandSurface *directRenderSurface() const;
-
QWindow *window()const;
virtual void surfaceCreated(QWaylandSurface *surface) = 0;
diff --git a/src/compositor/hardware_integration/qwaylandclientbufferintegration.h b/src/compositor/hardware_integration/qwaylandclientbufferintegration.h
index b3f30500..5d9902fa 100644
--- a/src/compositor/hardware_integration/qwaylandclientbufferintegration.h
+++ b/src/compositor/hardware_integration/qwaylandclientbufferintegration.h
@@ -73,8 +73,6 @@ public:
virtual bool isYInverted(struct ::wl_resource *) const { return true; }
- virtual bool setDirectRenderSurface(QWaylandSurface *) {return false;}
-
virtual void *lockNativeBuffer(struct ::wl_resource *, QOpenGLContext *) const { return 0; }
virtual void unlockNativeBuffer(void *, QOpenGLContext *) const { return; }
diff --git a/src/compositor/wayland_wrapper/qwlcompositor.cpp b/src/compositor/wayland_wrapper/qwlcompositor.cpp
index d798d5d7..8a7b1617 100644
--- a/src/compositor/wayland_wrapper/qwlcompositor.cpp
+++ b/src/compositor/wayland_wrapper/qwlcompositor.cpp
@@ -64,7 +64,6 @@
#include <QScreen>
#include <qpa/qplatformscreen.h>
#include <QGuiApplication>
-#include <qpa/qplatformscreenpageflipper.h>
#include <QDebug>
#include <QtCore/QAbstractEventDispatcher>
@@ -136,14 +135,10 @@ Compositor::Compositor(QWaylandCompositor *qt_compositor, QWaylandCompositor::Ex
: m_extensions(extensions)
, m_display(new Display)
, m_default_input_device(0)
- , m_pageFlipper(0)
, m_current_frame(0)
, m_last_queued_buf(-1)
, m_qt_compositor(qt_compositor)
, m_orientation(Qt::PrimaryOrientation)
- , m_directRenderSurface(0)
- , m_directRenderContext(0)
- , m_directRenderActive(false)
#if defined (QT_COMPOSITOR_WAYLAND_GL)
, m_hw_integration(0)
, m_client_buffer_integration(0)
@@ -300,8 +295,6 @@ void Compositor::destroySurface(Surface *surface)
m_surfaces.removeOne(surface);
m_dirty_surfaces.remove(surface);
- if (m_directRenderSurface == surface)
- setDirectRenderSurface(0, 0);
waylandCompositor()->surfaceAboutToBeDestroyed(surface->waylandSurface());
@@ -381,37 +374,6 @@ void Compositor::initializeWindowManagerProtocol()
m_windowManagerIntegration->initialize(m_display);
}
-bool Compositor::setDirectRenderSurface(Surface *surface, QOpenGLContext *context)
-{
-#ifdef QT_COMPOSITOR_WAYLAND_GL
- if (!m_pageFlipper) {
- m_pageFlipper = QGuiApplication::primaryScreen()->handle()->pageFlipper();
- }
-
- if (!surface)
- setDirectRenderingActive(false);
-
- if (m_client_buffer_integration && m_client_buffer_integration->setDirectRenderSurface(surface ? surface->waylandSurface() : 0)) {
- m_directRenderSurface = surface;
- m_directRenderContext = context;
- return true;
- }
-#else
- Q_UNUSED(surface);
-#endif
- return false;
-}
-
-void Compositor::setDirectRenderingActive(bool active)
-{
- if (m_directRenderActive == active)
- return;
- m_directRenderActive = active;
-
- if (m_pageFlipper)
- QMetaObject::invokeMethod(m_pageFlipper, "setDirectRenderingActive", Q_ARG(bool, active));
-}
-
QList<struct wl_client *> Compositor::clients() const
{
QList<struct wl_client *> list;
@@ -547,11 +509,6 @@ void Compositor::feedRetainedSelectionData(QMimeData *data)
m_qt_compositor->retainedSelectionReceived(data);
}
-void Compositor::scheduleReleaseBuffer(SurfaceBuffer *screenBuffer)
-{
- QMetaObject::invokeMethod(this,"releaseBuffer",Q_ARG(QPlatformScreenBuffer*,screenBuffer));
-}
-
void Compositor::overrideSelection(const QMimeData *data)
{
m_data_device_manager->overrideSelection(*data);
diff --git a/src/compositor/wayland_wrapper/qwlcompositor_p.h b/src/compositor/wayland_wrapper/qwlcompositor_p.h
index e6b82626..90529e5e 100644
--- a/src/compositor/wayland_wrapper/qwlcompositor_p.h
+++ b/src/compositor/wayland_wrapper/qwlcompositor_p.h
@@ -61,7 +61,6 @@ class QWaylandClientBufferIntegration;
class QWaylandServerBufferIntegration;
class WindowManagerServerIntegration;
class QMimeData;
-class QPlatformScreenPageFlipper;
class QPlatformScreenBuffer;
namespace QtWayland {
@@ -108,11 +107,6 @@ public:
void initializeHardwareIntegration();
void initializeDefaultInputDevice();
void initializeWindowManagerProtocol();
- bool setDirectRenderSurface(Surface *surface, QOpenGLContext *context);
- Surface *directRenderSurface() const {return m_directRenderSurface;}
- QOpenGLContext *directRenderContext() const {return m_directRenderContext;}
- QPlatformScreenPageFlipper *pageFlipper() const { return m_pageFlipper; }
- void setDirectRenderingActive(bool active);
QList<Surface*> surfaces() const { return m_surfaces; }
QList<Surface*> surfacesForClient(wl_client* client);
@@ -161,8 +155,6 @@ public:
void overrideSelection(const QMimeData *data);
void feedRetainedSelectionData(QMimeData *data);
- void scheduleReleaseBuffer(SurfaceBuffer *screenBuffer);
-
void bufferWasDestroyed(SurfaceBuffer *buffer) { m_destroyed_buffers << buffer; }
public slots:
void cleanupGraphicsResources();
@@ -185,8 +177,6 @@ private:
/* Output */
//make this a list of the available screens
OutputGlobal *m_output_global;
- //This one should be part of the outputs
- QPlatformScreenPageFlipper *m_pageFlipper;
DataDeviceManager *m_data_device_manager;
@@ -205,10 +195,6 @@ private:
QWaylandCompositor *m_qt_compositor;
Qt::ScreenOrientation m_orientation;
- Surface *m_directRenderSurface;
- QOpenGLContext *m_directRenderContext;
- bool m_directRenderActive;
-
#ifdef QT_COMPOSITOR_WAYLAND_GL
QScopedPointer<HardwareIntegration> m_hw_integration;
QScopedPointer<QWaylandClientBufferIntegration> m_client_buffer_integration;
diff --git a/src/compositor/wayland_wrapper/qwlsurface.cpp b/src/compositor/wayland_wrapper/qwlsurface.cpp
index 1e514b6e..9e07ba91 100644
--- a/src/compositor/wayland_wrapper/qwlsurface.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurface.cpp
@@ -98,10 +98,8 @@ Surface::~Surface()
delete m_waylandSurface;
delete m_subSurface;
- for (int i = 0; i < buffer_pool_size; i++) {
- if (!m_bufferPool[i]->pageFlipperHasBuffer())
- delete m_bufferPool[i];
- }
+ for (int i = 0; i < buffer_pool_size; i++)
+ delete m_bufferPool[i];
}
void Surface::releaseSurfaces()
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
index b4b26ee6..f877631b 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer.cpp
@@ -55,14 +55,13 @@ QT_BEGIN_NAMESPACE
namespace QtWayland {
SurfaceBuffer::SurfaceBuffer(Surface *surface)
- : QPlatformScreenBuffer()
- , m_surface(surface)
+ : m_surface(surface)
, m_compositor(surface->compositor())
, m_buffer(0)
, m_committed(false)
, m_is_registered_for_buffer(false)
, m_surface_has_buffer(false)
- , m_page_flipper_has_buffer(false)
+ , m_destroyed(false)
, m_is_displayed(false)
, m_texture(0)
, m_is_shm_resolved(false)
@@ -86,7 +85,6 @@ void SurfaceBuffer::initialize(struct ::wl_resource *buffer)
m_committed = false;
m_is_registered_for_buffer = true;
m_surface_has_buffer = true;
- m_page_flipper_has_buffer = false;
m_is_displayed = false;
m_destroyed = false;
m_handle = 0;
@@ -103,8 +101,6 @@ void SurfaceBuffer::initialize(struct ::wl_resource *buffer)
void SurfaceBuffer::destructBufferState()
{
- Q_ASSERT(!m_page_flipper_has_buffer);
-
destroyTexture();
if (m_buffer) {
@@ -116,7 +112,7 @@ void SurfaceBuffer::destructBufferState()
#ifdef QT_COMPOSITOR_WAYLAND_GL
} else {
QWaylandClientBufferIntegration *hwIntegration = m_compositor->clientBufferIntegration();
- hwIntegration->unlockNativeBuffer(m_handle, m_compositor->directRenderContext());
+ hwIntegration->unlockNativeBuffer(m_handle, 0);
#endif
}
}
@@ -166,22 +162,10 @@ void SurfaceBuffer::sendRelease()
wl_buffer_send_release(m_buffer);
}
-void SurfaceBuffer::setPageFlipperHasBuffer(bool owns)
-{
- m_page_flipper_has_buffer = owns;
-}
-
-void SurfaceBuffer::release()
-{
-}
-
void SurfaceBuffer::disown()
{
m_surface_has_buffer = false;
-
- if (!m_page_flipper_has_buffer) {
- destructBufferState();
- }
+ destructBufferState();
}
void SurfaceBuffer::setDisplayed()
@@ -243,7 +227,7 @@ void *SurfaceBuffer::handle() const
#ifdef QT_COMPOSITOR_WAYLAND_GL
} else {
QWaylandClientBufferIntegration *clientBufferIntegration = m_compositor->clientBufferIntegration();
- that->m_handle = clientBufferIntegration->lockNativeBuffer(m_buffer, m_compositor->directRenderContext());
+ that->m_handle = clientBufferIntegration->lockNativeBuffer(m_buffer, 0);
#endif
}
}
diff --git a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
index 3754d9b0..257c8246 100644
--- a/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
+++ b/src/compositor/wayland_wrapper/qwlsurfacebuffer_p.h
@@ -43,7 +43,6 @@
#include <QtCore/QRect>
#include <QtGui/qopengl.h>
-#include <qpa/qplatformscreenpageflipper.h>
#include <QImage>
#include <wayland-server.h>
@@ -63,7 +62,7 @@ struct surface_buffer_destroy_listener
class SurfaceBuffer *surfaceBuffer;
};
-class SurfaceBuffer : public QPlatformScreenBuffer
+class SurfaceBuffer
{
public:
SurfaceBuffer(Surface *surface);
@@ -80,9 +79,6 @@ public:
inline bool isRegisteredWithBuffer() const { return m_is_registered_for_buffer; }
void sendRelease();
- void setPageFlipperHasBuffer(bool owns);
- bool pageFlipperHasBuffer() const { return m_page_flipper_has_buffer; }
- void release();
void disown();
void setDisplayed();
@@ -96,6 +92,8 @@ public:
inline bool textureCreated() const { return m_texture; }
+ bool isDestroyed() { return m_destroyed; }
+
void createTexture();
inline GLuint texture() const;
void destroyTexture();
@@ -118,7 +116,7 @@ private:
bool m_committed;
bool m_is_registered_for_buffer;
bool m_surface_has_buffer;
- bool m_page_flipper_has_buffer;
+ bool m_destroyed;
bool m_is_displayed;
#ifdef QT_COMPOSITOR_WAYLAND_GL
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
index 7cc140cd..c9b8c9e4 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.cpp
@@ -79,7 +79,6 @@ public:
: egl_display(EGL_NO_DISPLAY)
, valid(false)
, display_bound(false)
- , flipperConnected(false)
, egl_bind_wayland_display(0)
, egl_unbind_wayland_display(0)
, egl_query_wayland_buffer(0)
@@ -90,7 +89,6 @@ public:
EGLDisplay egl_display;
bool valid;
bool display_bound;
- bool flipperConnected;
PFNEGLBINDWAYLANDDISPLAYWL egl_bind_wayland_display;
PFNEGLUNBINDWAYLANDDISPLAYWL egl_unbind_wayland_display;
PFNEGLQUERYWAYLANDBUFFERWL egl_query_wayland_buffer;
@@ -212,20 +210,6 @@ bool WaylandEglClientBufferIntegration::isYInverted(struct ::wl_resource *buffer
}
-bool WaylandEglClientBufferIntegration::setDirectRenderSurface(QWaylandSurface *surface)
-{
- Q_D(WaylandEglClientBufferIntegration);
-
- QPlatformScreen *screen = QPlatformScreen::platformScreenForWindow(m_compositor->window());
- QPlatformScreenPageFlipper *flipper = screen ? screen->pageFlipper() : 0;
- if (flipper && !d->flipperConnected) {
- QObject::connect(flipper, SIGNAL(bufferReleased(QPlatformScreenBuffer*)), m_compositor->handle(), SLOT(releaseBuffer(QPlatformScreenBuffer*)));
- d->flipperConnected = true;
- }
- Q_UNUSED(surface);
- return flipper;
-}
-
void *WaylandEglClientBufferIntegration::lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *) const
{
Q_D(const WaylandEglClientBufferIntegration);
diff --git a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h
index a289baa0..94d31fc8 100644
--- a/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h
+++ b/src/hardwareintegration/compositor/wayland-egl/waylandeglclientbufferintegration.h
@@ -59,8 +59,6 @@ public:
void bindTextureToBuffer(struct ::wl_resource *buffer) Q_DECL_OVERRIDE;
bool isYInverted(struct ::wl_resource *) const Q_DECL_OVERRIDE;
- bool setDirectRenderSurface(QWaylandSurface *) Q_DECL_OVERRIDE;
-
void *lockNativeBuffer(struct ::wl_resource *buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE;
void unlockNativeBuffer(void *native_buffer, QOpenGLContext *context) const Q_DECL_OVERRIDE;