[plugins/qpa] Call makeCurrent on the QOpenGLContext instead of the one in the platform context
ClosedPublic

Authored by graesslin on Aug 26 2016, 5:38 AM.

Details

Summary

SharingPlatformContext::swapBuffers needs to make the context current.
For this is calls makeCurrent. Later on this tries to bind a fbo, which
checks calls into the current QOpenGLContext. As we called makeCurrent on
our own platform context Qt doesn't know that the context is current and
returns in the worst case a nullptr and crashes.

This change calls makeCurrent on the QOpenGLContext so that Qt also knows
that this context is current now. The QOpenGLContext calls makeCurrent on
the platform context, so what our code tried to do is still being done.

In addition the method context() in AbstractPlatformContext is renamed to
eglContext to no longer shadow the method in QPlatformContext.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 6281.Aug 26 2016, 5:38 AM
graesslin retitled this revision from to [plugins/qpa] Call makeCurrent on the QOpenGLContext instead of the one in the platform context.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: KWin, Plasma on Wayland.
Restricted Application added projects: Plasma on Wayland, KWin. · View Herald TranscriptAug 26 2016, 5:38 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
bshah accepted this revision.Aug 26 2016, 5:45 AM
bshah added a reviewer: bshah.
This revision is now accepted and ready to land.Aug 26 2016, 5:45 AM
This revision was automatically updated to reflect the committed changes.