Pass function ptr to resolve glFunctions to initGL
ClosedPublic

Authored by graesslin on Nov 11 2016, 8:21 AM.

Details

Summary

KWin still resolves some OpenGL function pointers. For that it needs to
use either eglGetProcAddress or glxGetProcAddress. With other words the
method to resolve needs to know whether it is egl or glx and needs both
a dependency to egl and glx. Especially the dependency to glx is ugly as
that pulls in XLib into our library.

The way so far was to pass an enum value to the initGL method to know
whether it's EGL or GLX. With this change the enum value is removed and
replaced by a function pointer to resolve the methods.

This simplifies the resolve code and allows to completely remove the glx
variant we still had in the library. Thus kwinglutils library is now glx
and XLib free.

Test Plan

nested KWin with OpenGL/EGL still works

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 8085.Nov 11 2016, 8:21 AM
graesslin retitled this revision from to Pass function ptr to resolve glFunctions to initGL.
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 TranscriptNov 11 2016, 8:21 AM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
broulik added inline comments.
libkwineffects/kwinglutils_funcs.cpp
25–26

There's nothing above anymore

graesslin marked an inline comment as done.Nov 16 2016, 8:26 AM
graesslin updated this revision to Diff 8200.Nov 16 2016, 8:26 AM

Removed outdated comment

sebas accepted this revision.Nov 16 2016, 3:07 PM
sebas added a reviewer: sebas.
sebas added a subscriber: sebas.

nice, much cleaner that way.

This revision is now accepted and ready to land.Nov 16 2016, 3:07 PM
This revision was automatically updated to reflect the committed changes.