If a pixel is perfectly representable as an 8-bit number, don't add
dither. Reduce artifacts where dither is unnecessary.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Add bayer ordered dithering when presenting to screen. Reduce banding
when using a strong blur. Also use 16-bit intermediary textures to
preserve precision in the rendering pipeline.
Related: #602
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Users with an old EGL version won't be able to use the egl backend. OTOH
we shouldn't prevent them from running picom because of a feature they
won't even use.
Don't assume the existence of EGL 1.5 symbols.
Fixes#945
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
destroy_win_finish doesn't call win_release_images to free the images,
so we need to add a release_mask call there.
Related: #892
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
The intermediate texture used for shadow from mask calculation did not
properly set the min/mag filter to linear, which is required by the blur
methods. Because they use texture interpolation to accelerate
the convolution calculation.
Fixes#916
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Laying the usage message out by hand is tedious, also error prone
because the option names are duplicated at 2 places and have to be
consistent.
Create a struct to hold the option names and help messages, and
do layout programmatically.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Transparent clipping interacts poorly with programs whose transparent
interface elements must show windows below them for functionality,
for example screenshot utilities.
clang does not recognize the fallthrough annotation used in uthash.h, so we
change -Wimplicit-fallthrough to the single argument form currently only
supported by GCC.
We are still detecting implicit fallthroughs with GCC in CI.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This needs the EGL_KHR_image_pixmap and the GL_EXT_EGL_image_storage
extensions, which unfortunately aren't available on NVIDIA cards.
Don't add documentation for these, for now.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Since image_dst is in X coordinates, after flipping Y, we need to
subtract the height of the drawing area, to make it the bottom right
corner for OpenGL.
However, this breaks blur. Because we assumed the drawing area is the
same size as the texture, which is not the case for blur. So add the
height of the drawing area as another parameter.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Instead of always using the back texture/fbo. Also use the size of the
source texture, instead of hard coded back buffer size.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>