diff options
author | Giulio Camuffo <giulio.camuffo@jollamobile.com> | 2014-02-10 13:29:49 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-11 14:25:00 +0100 |
commit | 666f597ccd2ced23ecc71ba497981d1a88c34d77 (patch) | |
tree | ed8e1e89840688d78c3017de90a899d773b99144 /examples | |
parent | 8643053f8f5255fb8e21911c9e7287e675f4b4ed (diff) |
Remove the buffer queue.
A client calling attach(A);commit();attach(B);commit() should result
in its back buffer be set to B, and A be discarded.
If the client wants to have a queue it should keep it client side or
a protocol extension tailored for that purpose should be developed.
Change-Id: Ia0048f311504d85821df9f5b9225887801efec71
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/qwidget-compositor/main.cpp | 10 | ||||
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.cpp | 10 | ||||
-rw-r--r-- | examples/qwindow-compositor/qwindowcompositor.h | 4 |
3 files changed, 12 insertions, 12 deletions
diff --git a/examples/qwidget-compositor/main.cpp b/examples/qwidget-compositor/main.cpp index c0e688cf2..cf7fdda73 100644 --- a/examples/qwidget-compositor/main.cpp +++ b/examples/qwidget-compositor/main.cpp @@ -110,13 +110,13 @@ private slots: update(); } - void surfaceDamaged(const QRect &rect) { + void surfaceDamaged(const QRegion &rect) { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); surfaceDamaged(surface, rect); } protected: - void surfaceDamaged(QWaylandSurface *surface, const QRect &rect) + void surfaceDamaged(QWaylandSurface *surface, const QRegion &rect) { #ifdef QT_COMPOSITOR_WAYLAND_GL Q_UNUSED(surface); @@ -130,7 +130,7 @@ protected: void surfaceCreated(QWaylandSurface *surface) { connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); - connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); + connect(surface, SIGNAL(damaged(const QRegion &)), this, SLOT(surfaceDamaged(const QRegion &))); update(); } @@ -140,7 +140,7 @@ protected: QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); QSize windowSize = surface->size(); - surface->advanceBufferQueue(); + surface->swapBuffers(); if (!m_surfaceCompositorFbo) functions->glGenFramebuffers(1,&m_surfaceCompositorFbo); @@ -173,7 +173,7 @@ protected: QWaylandSurface *subSurface = i.next(); QPointF p = subSurface->mapTo(window,QPoint(0,0)); QSize size = subSurface->size(); - subSurface->advanceBufferQueue(); + subSurface->swapBuffers(); if (size.isValid()) { GLuint texture = 0; if (subSurface->type() == QWaylandSurface::Texture) { diff --git a/examples/qwindow-compositor/qwindowcompositor.cpp b/examples/qwindow-compositor/qwindowcompositor.cpp index 1d9c3d5e9..9eef717ef 100644 --- a/examples/qwindow-compositor/qwindowcompositor.cpp +++ b/examples/qwindow-compositor/qwindowcompositor.cpp @@ -159,7 +159,7 @@ void QWindowCompositor::surfaceUnmapped() ensureKeyboardFocusSurface(surface); } -void QWindowCompositor::surfaceDamaged(const QRect &rect) +void QWindowCompositor::surfaceDamaged(const QRegion &rect) { QWaylandSurface *surface = qobject_cast<QWaylandSurface *>(sender()); surfaceDamaged(surface, rect); @@ -170,7 +170,7 @@ void QWindowCompositor::surfacePosChanged() m_renderScheduler.start(0); } -void QWindowCompositor::surfaceDamaged(QWaylandSurface *surface, const QRect &rect) +void QWindowCompositor::surfaceDamaged(QWaylandSurface *surface, const QRegion &rect) { Q_UNUSED(surface) Q_UNUSED(rect) @@ -182,7 +182,7 @@ void QWindowCompositor::surfaceCreated(QWaylandSurface *surface) connect(surface, SIGNAL(destroyed(QObject *)), this, SLOT(surfaceDestroyed(QObject *))); connect(surface, SIGNAL(mapped()), this, SLOT(surfaceMapped())); connect(surface, SIGNAL(unmapped()), this, SLOT(surfaceUnmapped())); - connect(surface, SIGNAL(damaged(const QRect &)), this, SLOT(surfaceDamaged(const QRect &))); + connect(surface, SIGNAL(damaged(const QRegion &)), this, SLOT(surfaceDamaged(const QRegion &))); connect(surface, SIGNAL(extendedSurfaceReady()), this, SLOT(sendExpose())); connect(surface, SIGNAL(posChanged()), this, SLOT(surfacePosChanged())); m_renderScheduler.start(0); @@ -253,7 +253,7 @@ GLuint QWindowCompositor::composeSurface(QWaylandSurface *surface, bool *texture GLuint texture = 0; QSize windowSize = surface->size(); - surface->advanceBufferQueue(); + surface->swapBuffers(); QOpenGLFunctions *functions = QOpenGLContext::currentContext()->functions(); functions->glBindFramebuffer(GL_FRAMEBUFFER, m_surface_fbo); @@ -288,7 +288,7 @@ void QWindowCompositor::paintChildren(QWaylandSurface *surface, QWaylandSurface QWaylandSurface *subSurface = i.next(); QPointF p = subSurface->mapTo(window,QPointF(0,0)); QSize subSize = subSurface->size(); - subSurface->advanceBufferQueue(); + subSurface->swapBuffers(); if (subSize.isValid()) { GLuint texture = 0; if (subSurface->type() == QWaylandSurface::Texture) { diff --git a/examples/qwindow-compositor/qwindowcompositor.h b/examples/qwindow-compositor/qwindowcompositor.h index c58c0d571..f8d354c36 100644 --- a/examples/qwindow-compositor/qwindowcompositor.h +++ b/examples/qwindow-compositor/qwindowcompositor.h @@ -61,12 +61,12 @@ private slots: void surfaceDestroyed(QObject *object); void surfaceMapped(); void surfaceUnmapped(); - void surfaceDamaged(const QRect &rect); + void surfaceDamaged(const QRegion &rect); void surfacePosChanged(); void render(); protected: - void surfaceDamaged(QWaylandSurface *surface, const QRect &rect); + void surfaceDamaged(QWaylandSurface *surface, const QRegion &rect); void surfaceCreated(QWaylandSurface *surface); QWaylandSurface* surfaceAt(const QPointF &point, QPointF *local = 0); |