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>
When removing shadow behind a window with rounded corners, keep the
corner part - those parts will be removed using the mask instead.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
There are some complications, when sampling pixels outside a
xrender picture, xrender doesn't support a behaviour similar to OpenGL's
clamp to border. So we give the masks an extra 1-pixel outer rim, so
we can control what color the outside pixels would be, by using the
"Pad" repeat mode.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
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>
This does not ever happen in practice. But conceptually, the GL backend
holds 2 kinds of images: those in GL coordinate system, and those in X
coordinate system. They are differentiated by the `y_inverted` variable,
and applying alpha to them needs differs in whether y needs to be
inverted. Right now we never invert y, because we only ever call apply
alpha on images in the X coordinate system.
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>