Reverse shared context logic on GLX
AcceptedPublic

Authored by davidedmundson on Dec 12 2019, 10:02 AM.

Details

Reviewers
romangg
Group Reviewers
KWin
Summary

Currently we create Qt GL contexts that share with the core kwin
context.

If we do it the other way round, then with a special flag /any/
QQuickWindow will share context. Making life easier there.

On wayland our contexts are shared by default anyway as we control the
creation.

EffecttQuickView then only needs a boolean to decide whether to use the
shared texture path or the blitting path.

This is IMHO cleaner, but the other advantage is that it will allow
D23881 to use the kwin context creation path and get a shared context.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 19736
Build 19754: arc lint + arc unit
Restricted Application added a project: KWin. · View Herald TranscriptDec 12 2019, 10:02 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Dec 12 2019, 10:02 AM
romangg added inline comments.
plugins/platforms/x11/standalone/glxbackend.cpp
331

Would we here destroy Qt's context as well? In general what happens when compositing is switched off, does the Qt context just continue to exist without issues?

Qt's share context would last for the duration of the QApplication.

Ours compositing context would be created/destroyed when you toggle compositing, sharing the Qt one.
Every new QQuickWindow would create a new context that shares the static Qt one.

The share context never becomes current on a surface. It's purely for doing grouping.

romangg accepted this revision.Dec 12 2019, 12:31 PM
This revision is now accepted and ready to land.Dec 12 2019, 12:31 PM