Commit Graph

1775 Commits

Author SHA1 Message Date
Yuxuan Shui
fbe7ed5699 options: improve usage message printing
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>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
0004173ecd Rename COMPTON_VERSION to PICOM_VERSION
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Stefan Radziuk
1e5de4067b picom upto date sync with yshui, full anim support 2023-01-23 07:34:35 +03:00
Yuxuan Shui
04b80760d8 win: fix leak in win_bind_mask
Related: #905

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:33:56 +03:00
Arda Atci
f6b0b04f5b picom upto date sync with yshui, full anim support 2022-10-04 00:24:05 +03:00
Yuxuan Shui
7107241519 meson.build: no -Wimplicit-fallthrough when building with clang
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>
2022-09-30 11:26:50 +01:00
Yuxuan Shui
c1dc11f59c backend: egl: fix resource leak
Destroy context and surface as well in egl_deinit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 19:09:59 +01:00
Yuxuan Shui
0fe4e0a1d4 Merge pull request #878 from yshui/egl
Add an experimental egl backend
2022-09-29 08:06:36 +01:00
Yuxuan Shui
b71a8420ca options: add warning for using the egl backend 2022-09-29 08:03:21 +01:00
Yuxuan Shui
94183c8e03 README: add libEGL dependency
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 08:03:20 +01:00
Yuxuan Shui
5a72b5755d backends: add egl backend
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>
2022-09-29 08:03:12 +01:00
Yuxuan Shui
5ac8b7fc56 backend: gl: use gaussian blur for shadow
dual kawase is fast but its blur size is coarse grained, which sometimes
makes the shadow ugly.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-18 05:00:52 +01:00
Yuxuan Shui
f2970bc697 Merge pull request #882 from yshui/shadow 2022-09-16 15:15:15 +01:00
Yuxuan Shui
95e5732d66 Merge pull request #881 from yshui/blur
Fix blur behind rounded corner windows
2022-09-16 15:14:35 +01:00
Yuxuan Shui
7ae89d6d62 Merge pull request #880 from yshui/mask
Fixes #783, replaces #831
2022-09-16 15:13:52 +01:00
Yuxuan Shui
483aa4347c backend: allocate mask only when necessary
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:59 +01:00
Yuxuan Shui
5d2f8d7456 backend: gl: fix visible seam in shadow at edge of windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:58 +01:00
Yuxuan Shui
8c14d5354c backend: gl: fix mask being inverted
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:55 +01:00
Yuxuan Shui
a29caeaf3d ackend: gl: implement shadow_from_mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-31 07:00:41 +01:00
Yuxuan Shui
9ac046c2ba backend, win: create shadows with shadow_from_mask
Do this for shaped, and rounded windows.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-26 05:43:19 +01:00
Yuxuan Shui
a9ec614286 backend: add shadow_from_mask based implementation of render_shadow
If the backend implements shadow_from_mask then it doesn't need to
implement render_shadow.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-26 05:43:17 +01:00
Yuxuan Shui
de209fd52c backend: gl: fix x_rect_to_coords when y_inverted is false
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>
2022-08-26 05:43:12 +01:00
Yuxuan Shui
94e3d4d483 kernel: be more conservative when estimating deviation
Using integral to estimate the sum of the kernel will overestimate a
little bit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-26 05:42:58 +01:00
Yuxuan Shui
84407099a9 backend: give backends more flexibility regarding shadow creation
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-26 05:42:51 +01:00
Yuxuan Shui
e942f253f7 backend: gl: make blur take a source texture and a target fbo
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>
2022-08-25 18:07:57 +01:00
Yuxuan Shui
e2d990dc3d backend: gl: split code into multiple files
gl_common.c is getting too big.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 13:31:54 +01:00
Yuxuan Shui
137a47261c backend: xrender: handle blur mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 03:47:22 +01:00
Yuxuan Shui
6b7a5dd6cf backend: gl: handle blur mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 03:47:15 +01:00
Yuxuan Shui
e680e8b30d backend: gl: clear up textures
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 02:59:06 +01:00
Yuxuan Shui
b9d4b8a851 backend: gl: factor out shader code for masking
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 02:59:05 +01:00
Yuxuan Shui
9e8373e3e0 backend: add mask parameter to blur
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-25 02:59:01 +01:00
Yuxuan Shui
e4221e0787 backend: don't clip corners when painting shadow
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>
2022-08-25 02:51:03 +01:00
Yuxuan Shui
4bf7669ec3 backend: xrender: handle masks
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>
2022-08-25 02:50:57 +01:00
Yuxuan Shui
56a733840c backend: glx: handle masks
Use masks in compose.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-24 08:39:26 +01:00
Yuxuan Shui
9b419504e8 backend: add the make_mask interface
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>
2022-08-24 08:39:21 +01:00
Yuxuan Shui
e0758eb5e5 backends: glx: fix apply alpha of non y inverted images
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>
2022-08-23 10:06:27 +01:00
Yuxuan Shui
a252cbf028 clang-tidy: disable some noisy warnings
Also fix some of the warnings

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-23 05:19:06 +01:00
Yuxuan Shui
748cd665f4 backend: glx: fix glx vendor check
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-22 10:41:16 +01:00
Yuxuan Shui
9f01d0dfbe Merge pull request #875 from yshui/legacy-backend 2022-08-21 23:05:42 +01:00
Yuxuan Shui
5d6326ae28 meson.build: autostart picom
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 06:25:55 +01:00
Yuxuan Shui
b0fbfec4f0 man: fix typos
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 06:13:24 +01:00
Yuxuan Shui
7e607bfe81 Make experimental backends the new default
Experimental no longer.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 06:09:27 +01:00
Yuxuan Shui
3dfc422edf Merge pull request #851 from yshui/507
Closes #386  #507
2022-08-21 05:46:56 +01:00
Yuxuan Shui
35b403ac9c man: describe where to put a shader file
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 05:43:33 +01:00
Yuxuan Shui
fcaf0f993e man: include a default shader
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 05:37:59 +01:00
Yuxuan Shui
1de1d67126 picom.sample.conf: add window-shader-fg and window-shader-fg-rule
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 05:37:28 +01:00
Yuxuan Shui
19c852b3ae options: mention the "default" shader
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-21 05:22:15 +01:00
Yuxuan Shui
affe408d76 meson: fix meson warnings
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-17 17:55:53 +00:00
Yuxuan Shui
4e0fad5880 man: define the custom shader interface
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-12 14:27:05 +01:00
Yuxuan Shui
32478df27c core: force redraw if animated shader is in-use
I also noticed there is an opportunity to unify fades, animated shaders,
and the benchmark mode. We should be able to get rid of the fade timer.
A TODO for the future.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-08-12 13:45:30 +01:00