diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-01-14 13:04:59 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-15 15:11:35 +0100 |
commit | a848e7fe3c69b3eede115fbfe21e9024514bb226 (patch) | |
tree | 45b0825a90ecd2889215aadbcae8c51de9e83363 /src/hardwareintegration | |
parent | 3e39883a8a87f99521805ed1feb495bfbcfeef0c (diff) |
Fix up brcml-egl buffer swap
There is no need to do attach/damage/commit on the gui thread, doing it
on whatever thread we are (e.g. the render thread of scenegraph) is fine.
There is no need for flushRequests() either which means the entire metacall
can be removed.
Change-Id: Ia2ecf7cacc97787e68a97dc6a02641653e072ed3
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/hardwareintegration')
-rw-r--r-- | src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp | 30 | ||||
-rw-r--r-- | src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h | 5 |
2 files changed, 3 insertions, 32 deletions
diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp index 5c67ba8e5..b538d32c8 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.cpp @@ -249,38 +249,14 @@ void QWaylandBrcmEglWindow::swapBuffers() } m_buffers[m_current]->bind(); - - m_mutex.lock(); - m_pending << m_buffers[m_current]; - m_mutex.unlock(); - - // can't use a direct call since swapBuffers might be called from a separate thread - QMetaObject::invokeMethod(this, "flushBuffers"); + attach(m_buffers[m_current], 0, 0); + damage(QRect(QPoint(), geometry().size())); + commit(); m_current = (m_current + 1) % m_count; - m_buffers[m_current]->waitForRelease(); } -void QWaylandBrcmEglWindow::flushBuffers() -{ - if (m_pending.isEmpty()) - return; - - QSize size = geometry().size(); - - m_mutex.lock(); - while (!m_pending.isEmpty()) { - QWaylandBrcmBuffer *buffer = m_pending.takeFirst(); - attach(buffer, 0, 0); - damage(QRect(QPoint(), size)); - commit(); - } - m_mutex.unlock(); - - mDisplay->flushRequests(); -} - bool QWaylandBrcmEglWindow::makeCurrent(EGLContext context) { if (!m_count) diff --git a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h index 5a3fa0461..73413c6ba 100644 --- a/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h +++ b/src/hardwareintegration/client/brcm-egl/qwaylandbrcmeglwindow.h @@ -68,9 +68,6 @@ public: bool makeCurrent(EGLContext context); void swapBuffers(); -private slots: - void flushBuffers(); - private: void createEglSurfaces(); void destroyEglSurfaces(); @@ -93,8 +90,6 @@ private: int m_current; int m_count; - QList<QWaylandBrcmBuffer *> m_pending; - QMutex m_mutex; }; |