Commit Graph

1798 Commits

Author SHA1 Message Date
Yuxuan Shui
2173654fbd options: add dithered-present option
See also 0a2cd0f14e

Related: #602

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
123ef51210 backend: gl: add dither
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>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
4ecc3e65a9 man: fix typo
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
4a7a9e8079 Update README.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Maxim Solovyov
dacadb9fc3 README: fix meson's warnings about setup commands
this fixes `WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.` warning while setting up the project
2023-01-23 07:34:35 +03:00
Jake
144e78fd5d Change dreaw -> draw 2023-01-23 07:34:35 +03:00
Yuxuan Shui
d647ccca16 README: update pcre requirements
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
9fe7e65e3e c2: replace pcre with pcre2
Because pcre has been deprecated.[1]

There are subtle changes from pcre to pcre2, so this could be a breaking
change.

Closes #895

[1]: https://www.pcre.org/original/changelog.txt

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Evgeniy Baskov
ad5a042803 win: consider border when creating the mask image
With rounded corners, X11 native border and blur enabled, left and
bottom 2*border_width pixels were not blurred, since mask did not
include border_width, only content width and height.

Create mask image with dimensions that include border width.

Signed-off-by: Evgeniy Baskov <j-basevgser@yandex.ru>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
0a82f460e0 backend: egl: fix warning 2023-01-23 07:34:35 +03:00
Yuxuan Shui
49490ab99f backend: egl: fix undefined symbols on old systems
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>
2023-01-23 07:34:35 +03:00
h7x4
9bf39b8d1d picom.sample.conf: Add egl to backend option doc 2023-01-23 07:34:35 +03:00
Omar Polo
11a195747a backend: egl: don't assume glEGLImageTargetTexStorage exists
Use eglGetProcAddress instead.

Fixes #932
2023-01-23 07:34:35 +03:00
Yuxuan Shui
89690c9843 win: fix leaking of the mask image
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>
2023-01-23 07:34:35 +03:00
Omar Polo
935885d396 fix log_debug call 2023-01-23 07:34:35 +03:00
Yuxuan Shui
611f8b80c2 backend: gl: handle blur context creation failure
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
8f848c2b1d backend: gl: fix crash when shadow radius is 0
Fixes #927

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
a10a64f984 Fix typo
Fixes #922

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
1434881567 win: assert we won't clobber existing mask
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
fa21c44ee7 backend: gl: fix shadow from mask
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>
2023-01-23 07:34:35 +03:00
Yuxuan Shui
dbb81b5116 doc: remove mention of raw string pattern
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
Alp
f7596fd43a rounded corner delay fix 2023-01-23 07:34:35 +03:00
Yuxuan Shui
f7a950a638 Bump version number
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-01-23 07:34:35 +03:00
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