This is used to create image masks that can be used to mask out
`compose` regions. For example, this can be used to mask out window body
so shadow won't be painted on them.
This could be more efficient than using rectangular regions for masking,
when there are a large number of rectangles; or more flexible, in the
case of window with rounded corners.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
GCC warns about a use after free, because a pointer is used in pointer
comparison after it was freed. This particular case is completely safe,
but GCC warns anyway.
Move the free after the comparison requires me duplicating the free a
couple of times, so instead I made use of the cleanup attribute to auto
free the pointer when it goes out of scope.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Some versions of the Android libc do not have timespec_get(), use
clock_gettime() instead on Android.
Signed-off-by: Rafael Kitover <rkitover@gmail.com>
Rename `popcountl` to `popcntul` to avoid name conflicts with NetBSD
system headers.
Remove the unused `popcount` function.
Closes#502
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
leftovers:
1) config file path. Has to implement compatibility functionalities before
we can change it.
2) links in man pages. Has to migrate the repo first.
3) _COMPTON_SHADOW, it has become a defacto standard, so we have to keep
supporting it.
4) dbus names, undecided whether we should/could change it.
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>
* string functions mstr*() are moved to string_utils.c
* allocation wrappers are moved to utils.h
* printf_* functions are moved to log.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Use optnone instead, this does require a more recent clang though. In
general, just don't use -ffast-math.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
IANAL, but I think I am allowed to add missing copyright notices for
someone else. And I did my best job using git history to figure out who
wrote which functions. So I hope everything is fine.