Now both the old and the new backends are compiled in, the user can
choose which one to use with a command line switch.
Lower the barrier for testing.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
After converting from struct conv to xorg format, cache the result to
save CPU time.
And remove an unused function.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of storing them as an array of xfixed.
Might cause some performance overhead for the new backend, because
it is allocating a buffer to do the conversion every frame. Will fix
later.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Window state tracking is basically the back bond of window fading. We
add a new enum field to the win struct to track the state of the window,
instead of using a set of boolean variables. We also remove the fading
callbacks, since it is only used for fading, so the potential of code
reuse is lost. And it makes the code slightly harder to understand.
Also fixed a problem that --no-fading-openclose is not behaving as
advertised (from my observation, enabling this flag disables fading
entirely, instead of just diabling it for open/close).
Also uses double for opacity everywhere internally. Use opacity_t only
when setting X opacity prop.
TODO: Remove win::*_last
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Put them all into one function, and move the function pointers out of
glx_session_t, making them global variables (because them don't change
after initialized). Remove the function pointer typedefs and replace
them with the ones in glxext.h
We also only lookup the functions once per a lifetime of compton.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Background: To bind a Xorg window content to a OpenGL FBConfig, which
has to match the color format the Xorg window is using.
Previously, compton just find a FBConfig that has the same depth. This
led to chjj/compton#477, which has been fixed by a ugly hack.
The commit refactor the lookup mechanism to take as much into
consideration as we reasonably can. Hopefully preventing similar
breakages in the future.
Also, some code sharing between the old and new glx backend.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Xorg uses top left as origin, OpenGL uses lower left. So we need to flip
the y axis, and make sure we are using the right points as origin of
windows.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Buffer age is not a glx specific concept. xrender backend can have
buffer age too, if double buffering is used (required if we want to use
Present). So, make buffer age a generic concept in compton is required
for further backend improvements.
Moved buffer age based damage aggragation out of glx as well.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Slightly clean up header inclusion with the help of clang's module system.
It's better for files to include the things you need directly.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>