This is to make the access to X server more explicit, and make managing
the lifetime of xcb_connection_t a bit easier.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
cache uses an invasive design now, a la list.h and uthash. This get rid
of the ugly integer to pointer cache, and gives us freedom of what we
can put into the cache.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Added a pure version of `cache_get` which does not change the cache, and
renamed the old `cache_get` to `cache_get_or_fetch`.
Remove unused `cache_set`, and remove prefix underscore from function
names.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
It's quite confusing what should be passed into what because too many
things are `void *`. So give images a type to make things a bit clearer.
Because of C's limited type system, we lose the ability to annotate them
as nonnull or const, well you win some you lose some.
Also while doing this I noticed error handling around this is a bit
lacking.
Co-authored-by: Maxim Solovyov <msolovyov@protonmail.com>
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Later in win_process_update_flags, we check for WIN_FLAGS_FACTOR_CHANGED
and will call win_on_factor_change if needed. So in
win_update_bounding_shape we just need to set that flag. Otherwise we
call win_on_factor_change multiple times unnecessarily.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This should marginally speed up pixmap binding for the glx backend (we
don't need FBConfigs for egl).
Fix a long running complaint in #381 (unrelated issue, but there is
complaint in there about glXChooseFBConfig being called whenever we bind
a new pixmap).
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
to avoid creating and destroying it every frame
(cherry picked from commit 5a1990b236c85f1222098ef147398855cbb3af69)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
it sets an x region to a pixman region
(cherry picked from commit efb7a1430f2c530c7b9cc0cb6d6d6cff95d8a4d9)
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Basically we won't call xcb_damage_subtract if show_all_xerrors is set,
which is very bad.
Fixes that, and also make sure the damage subtract request is flushed in
all branches.
Fixes: 1307d9ec70
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of change window attributes back and forth, calculate the evmask
and set it just once. And also make sure the request is flushed.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>