Plotter: Scope GL Program to lifespan of scenegraph node

Authored by davidedmundson on Apr 18 2019, 10:15 AM.

Description

Plotter: Scope GL Program to lifespan of scenegraph node

Summary:
Currently the QOpenGLProgram was static. This works when you only have
one OpenGL context that is never invalidated.

Instead we shoul have a new program created for each context. There is
no benefit of being static when we can use the cached shader loading.

As we need a program per context, we would need to handle windowChanged
and sceneGraphInvalidated manually. Instead we can scope the program to
the QSGNode which will be deleted and recreated on the render thread
automatically by the scene graph backend.

We can also drop ManagedTextureNode and use
QSGSimpleTextureNode::setOwnsTexture which does the same thing.

BUG: 403453

Test Plan:
Created a CPU load viewer on my panel
Dragged it to my desktop
Previously that didn't render anything
Now it does

It should fix the crashes that we
see on window moves and handling sceneGraphInvalidated

Reviewers: Plasma

Subscribers: kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D20656

Details

Committed
davidedmundsonApr 18 2019, 4:14 PM
Differential Revision
D20656: Plotter: Scope GL Program to lifespan of scenegraph node
Parents
R296:d9a0365ccc49: use the base implementation hints
Branches
Unknown
Tags
Unknown