diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-01-03 17:28:51 +0100 |
---|---|---|
committer | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-03-04 13:19:00 +0000 |
commit | 6afccbd1e25abd95a9c239e175442b79e12f8c87 (patch) | |
tree | 2723c1837c17227568440544149087edcf402917 /src/plugins/scenegraph/softwarecontext/softwarelayer.cpp | |
parent | 13a6c51f26128015c0a3c335bdae676b46df6ed6 (diff) |
Partial update support
This enables partial update support, which leads to only painting into
the backingstore what has changed in the scene each frame, and then only
flushing the changed regions to the window surface.
Change-Id: I2a3c8676bd4539100a4313069f894f157bfb0ea4
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/scenegraph/softwarecontext/softwarelayer.cpp')
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/softwarelayer.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp index 712bb6f647..7064bc854e 100644 --- a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp +++ b/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp @@ -30,6 +30,7 @@ #include "softwarelayer.h" #include "context.h" +#include "pixmaprenderer.h" SoftwareLayer::SoftwareLayer(QSGRenderContext *renderContext) : m_item(0) @@ -216,6 +217,9 @@ void SoftwareLayer::grab() if (m_pixmap.size() != m_size) { m_pixmap = QPixmap(m_size); m_pixmap.setDevicePixelRatio(m_device_pixel_ratio); + // This fill here is wasteful, but necessary because it is the only way + // to force a QImage based pixmap to have an alpha channel. + m_pixmap.fill(Qt::transparent); } // Render texture. @@ -230,7 +234,7 @@ void SoftwareLayer::grab() m_mirrorVertical ? m_rect.top() * m_device_pixel_ratio : m_rect.bottom() * m_device_pixel_ratio, m_mirrorHorizontal ? -m_rect.width() * m_device_pixel_ratio : m_rect.width() * m_device_pixel_ratio, m_mirrorVertical ? m_rect.height() * m_device_pixel_ratio : -m_rect.height() * m_device_pixel_ratio); - m_renderer->m_projectionRect = mirrored; + m_renderer->setProjectionRect(mirrored); m_renderer->setClearColor(Qt::transparent); m_renderer->renderScene(); |