1. Increase cognitive complexity threshold to 50. The default value of
25 marks a lot of functions, which is too noisy to be useful.
2. Ignore int8_t in signed char to integer conversion check.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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>