Don't trigger composeAndFlush for native child widgets unless needed

The textureChildSeen flag is set on each widget the first time it has
a child needing textures, which triggers the composeAndFlush codepath.

If a top level widget had a child needing this codepath, but other
native children not needing it, we ended up always using composeAndFlush
for the native children, since we were checking textureChildSeen of the
top level widget.

We should check the child widget instead, which will never have the flag
set unless itself had children that required composeAndFlush. This matches
the logic in findAllTextureWidgetsRecursively, which also checks the
child widget and not the top level widget.

Done-width: Laszlo Agocs <laszlo.agocs@qt.io>
Change-Id: I65064eef41e56d9c1a789a96cedb98b11e8a177a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-08-02 16:20:06 +02:00
parent ffae448dc3
commit 4b7cb3bc91

View File

@ -1044,7 +1044,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget)
}
}
if (QWidgetPrivate::get(tlw)->textureChildSeen) {
if (QWidgetPrivate::get(widget)->textureChildSeen) {
// No render-to-texture widgets in the (sub-)tree due to hidden or native
// children. Returning null results in using the normal backingstore flush path
// without OpenGL-based compositing. This is very desirable normally. However,