WindowThumbnail: Do GL calls in the correct thread

Review Request #128763 - Created Aug. 26, 2016 and submitted

Information
David Edmundson
plasma-framework
d6fd702...
Reviewers
kdeframeworks, plasma

WindowThumbnail did some open GL operations, discarding old textures, in the GUI thread. Whislt it's not going to cause a threading issue (as updatePaintNode always ran when the main thread was blocked) we're not meant to mix threads with openGL contexts.

It also seems to have a GL leak on nvidia, which was previously masked
by the double delete fixed in https://git.reviewboard.kde.org/r/126131/diff/2/
It seems only one worked, and in the applied version we went with the wrong one.

This patch makes use of QQuickItem::releaseResources to delete the GL
textures on window change and destructor; it's then removed from
stopRedirecting so that start/stop redirecting handles xcb on the GUI thread and updatePaintNode/discardPixmap is the GL stuff on the render thread.

See http://doc.qt.io/qt-5/qquickitem.html#graphics-resource-handling

REVIEW:

Using nvidia with proprietory drivers (which puts me QSG_RENDER_LOOP=threaded) mouse over the panel a lot. VRAM didn't increase. Previews still appear.
"Used Dedicated Memory:" in nvidia-settings remained roughly static, rather than constantly increasing.

Issues

  • 1
  • 1
  • 1
  • 3
Description From Last Updated
This is added in Qt 5.6, but: set (REQUIRED_QT_VERSION "5.3.0") which is also wrong. Hrvoje Senjan Hrvoje Senjan
Martin Flöser
Martin Flöser
David Edmundson
Martin Flöser
David Edmundson
Martin Flöser
David Edmundson
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 8e517b1578ad1e5988f440790f5048416a7dd68c by David Edmundson to branch master.
Hrvoje Senjan

   

This is added in Qt 5.6, but:
set (REQUIRED_QT_VERSION "5.3.0")
which is also wrong.

Loading...