summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbbackingstore.cpp
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@digia.com>2013-12-18 14:48:22 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-12 20:12:17 +0100
commiteacd58d4e78e7238ba5fcca90ba960aaf3ebd263 (patch)
tree779bf1735aecb7985bc3136264b9147eb23d5374 /src/plugins/platforms/xcb/qxcbbackingstore.cpp
parent5ae5bebb93ec38e17c0dcb9bec47e0ebfbce4937 (diff)
Enabling QQuickWidget and QOpenGLWidget
Enable child widgets (without a native window) that render to an FBO and are composed with the raster backingstore by the platform plugin. A preliminary version of QOpenGLWidget is included as private API. Change-Id: I8f984a4d7db285069ce3d6564707942c823d890d Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbbackingstore.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 366e043e98..1579797f85 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -280,6 +280,11 @@ void QXcbBackingStore::beginPaint(const QRegion &region)
}
}
+QImage QXcbBackingStore::toImage() const
+{
+ return m_image && m_image->image() ? *m_image->image() : QImage();
+}
+
void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
if (!m_image || m_image->size().isEmpty())
@@ -319,6 +324,25 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion &region, const QPoin
}
}
+#ifndef QT_NO_OPENGL
+void QXcbBackingStore::composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+ QPlatformTextureList *textures, QOpenGLContext *context)
+{
+ QPlatformBackingStore::composeAndFlush(window, region, offset, textures, context);
+
+ Q_XCB_NOOP(connection());
+
+ if (m_syncingResize) {
+ QXcbWindow *platformWindow = static_cast<QXcbWindow *>(window->handle());
+ connection()->sync();
+ m_syncingResize = false;
+ platformWindow->updateSyncRequestCounter();
+ } else {
+ xcb_flush(xcb_connection());
+ }
+}
+#endif // QT_NO_OPENGL
+
void QXcbBackingStore::resize(const QSize &size, const QRegion &)
{
if (m_image && size == m_image->size())