summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-06-21 13:23:55 +0200
committerAndy Shaw <andy.shaw@qt.io>2018-07-12 05:35:54 +0000
commit13cbbef38cf7dd58a5550a8548a9ea9e820cca85 (patch)
tree9353420aa368bd0092720f60e1cee47acec0bc56 /src
parentd3837d4df7dee96db2d9e30270f52def7d49f585 (diff)
QQuickRenderControl: Grab framebuffer with alpha if the window uses it
Change-Id: Ie11e86be997d749e6f82f0fb81a82bb0b50ab1f1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickrendercontrol.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 49568db552..fb1c6366f2 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -386,7 +386,8 @@ QImage QQuickRenderControl::grab()
cd->syncSceneGraph();
d->rc->endSync();
render();
- grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false);
+ const bool alpha = d->window->format().alphaBufferSize() > 0 && d->window->color().alpha() < 255;
+ grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), alpha, alpha);
if (QQuickRenderControl::renderWindowFor(d->window)) {
grabContent.setDevicePixelRatio(d->window->effectiveDevicePixelRatio());
}