Commit Graph

23 Commits

Author SHA1 Message Date
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 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 e50be3173f
backend: remove the read_pixel interface.
Sample the border color in the shader instead.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 17:34:38 +00:00
Yuxuan Shui b7df820ff2
backend: add new property: BORDER_WIDTH
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 17:34:33 +00:00
Yuxuan Shui ffe1b79881
backend: add new property: BORDER_COLOR
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-01-24 17:34:29 +00:00
Yuxuan Shui de31cd4096
backend: add new image property: corner radius
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-10-23 12:21:52 +01:00
Yuxuan Shui 2a60836a9b
backend: split image_op into image_op and set_image_property
Currently there is some inconsistency in how image_op is implemented
across backends. The glx backend applies some of the image operations
lazily, and not always in the order the operations were made; while the
xrender backend applies the operations eagerly. This can lead to
different render result in some cases.

Instead of trying to preserving the order of operations, which would be
unnecessary, we re-model the API to better reflect the implementation.
We make it clear that setting the property doesn't change the image
data, and properties are only applied during composition and in a
specific order.

This makes sure the render result looks consistent across backends.
Should also improve the performance of the xrender backend, even if only
slightly.

Also distill out the property management code so they can be shared.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2021-06-20 06:49:38 +01:00
Bernd Busse d45d0ca209
backend: create dual_kawase blur parameters from selected strength [WIP]
**Work-in-Progress**

Generate suitable parameters for dual-filter kawase blur based on the
selected `blur-strength` or approximate a gauss blur with the selected
`blur-size` and std-deviation.
2020-08-31 14:06:18 +02:00
Yuxuan Shui c1b2ce1fce
Update generate_blur_kernel to use abstract parameter type
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-06-09 12:44:32 +01:00
Yuxuan Shui f64ac97a91
Return kernel count from kernel generation functions
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-06-09 00:45:06 +01:00
Yuxuan Shui be673f93c6
backend: add interfaces for readiness reporting
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:33 +01:00
Yuxuan Shui 0037b7e5fb
Eliminate implicit conversions
Use explicit conversions everywhere. Adding bounds check assertions when
necessary.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:25 +01:00
Yuxuan Shui a2ae36c1d6
backend_common: fix shadow generation with opacity
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-04 23:02:35 +00:00
Yuxuan Shui 3707f792fb
new_backend: New interface
Move more logic out of the backend. The backends are now more agnostic
to what happens in compton.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-03 22:18:34 +00:00
Yuxuan Shui 0ceee9aad1
solid_picture and build_shadow shouldn't take session_t
Pass xcb_connection_t and xcb_drawable_t instead, which is what these
functions need.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-26 23:21:11 +00:00
Yuxuan Shui c2f274ca8a
Fix some problems in new backend integration
Fix several use of uninitialized/unallocated variables when using
--experimental-backends

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-20 18:17:16 +00:00
Yuxuan Shui b1d8687b31
Add copyright notice to backend/**
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:47:36 +00:00
Yuxuan Shui 7ac351e5b5
Move some default_* functions to backend_common.c
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-03 18:41:02 +00:00
Yuxuan Shui 82e8b09d56
Move paint_all_new to backend.c
Fix build with -Dnew_backends=false. And more build test for this case.

Fixes #83

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-02 20:36:33 +00:00
Yuxuan Shui 428c24a6fa
Speed up shadow generation for small windows
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-01 11:35:59 +00:00
Yuxuan Shui 3686bf7a33
Use functions in backend/backend_common.c
Build backend_common.c even when new_backend=false.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-01 11:01:47 +00:00
Yuxuan Shui 86713c8170
Add make_shadow and paint_all_new to backend_common.c
Also made make_shadow private in render.c

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-31 14:30:58 +00:00
Yuxuan Shui 0c4b690b2b
First step of split backend into modules
This commit introduced a new, modular backend interface. The interface
is not very good, since I don't think I fully understand all the
requirements writing a backend have. But this is a good first step.

This commit also includes an initial xrender backend written using the
new interface, and some opengl backend related helper functions, which
are taken from the old opengl backend.

However, there is not integration with the core compton yet. compton
will still use the old backend code. This commit is here so we can get
the automated build test.

What is implemented in the new xrender backend:

* Windows with transparency
* Shadow
* Opacity
* Wallpaper (getting the root pixmap)
* Blur

Known problem with the xrender backend:

* It is slower

Things that still need to be figured out:

* What is the better way to add vsync to the new backends

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-22 00:50:25 +00:00