diff options
author | Paul Olav Tvete <paul.tvete@digia.com> | 2013-12-18 14:48:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 20:12:17 +0100 |
commit | eacd58d4e78e7238ba5fcca90ba960aaf3ebd263 (patch) | |
tree | 779bf1735aecb7985bc3136264b9147eb23d5374 /src/plugins/platforms/xcb/qxcbbackingstore.cpp | |
parent | 5ae5bebb93ec38e17c0dcb9bec47e0ebfbce4937 (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.cpp | 24 |
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 ®ion) } } +QImage QXcbBackingStore::toImage() const +{ + return m_image && m_image->image() ? *m_image->image() : QImage(); +} + void QXcbBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { if (!m_image || m_image->size().isEmpty()) @@ -319,6 +324,25 @@ void QXcbBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoin } } +#ifndef QT_NO_OPENGL +void QXcbBackingStore::composeAndFlush(QWindow *window, const QRegion ®ion, 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()) |