Commit Graph

25 Commits

Author SHA1 Message Date
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 685a583f84
backend: add preliminary support for driver detection
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui bd4c242015
win: split struct win
Currently compton handles window creation event by immediately query all
the information it needs and create a window struct with that
information. However, this is prone to race conditions.

In the future, we want to react to window creation event by creating a
placeholder in the window stack, and only query window information in a
critical section where the X server is grabbed by us.

This commit split struct win into two struct, one as placeholder, the
other for holding actual window information.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:29 +01:00
Yuxuan Shui 0a32c81d9c
backend interface: improve documentation 2019-03-16 20:57:43 +00:00
Yuxuan Shui 34254ff86e
new glx: implement fill for monitor-repaint
Refine the API of fill_rectangle and rename it to fill.

Extras:

Keep GL_BLEND enabled; Fixed some texture/fbo leaks

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-10 01:53:46 +00:00
Yuxuan Shui c5d9f459dd
backend interface: add IMAGE_OP_RESIZE_TILE
We need this to paint the wallpaper with repeat to mimic the behavior of Xorg's
background pixmap.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-09 18:01:18 +00:00
Yuxuan Shui 6ff0facae6
backend: invert color and dim doesn't need reg_op
We only ever invert color of or dim the entire image, so just remove the
ability to do region based inversion and dimming. Making implementing
image_op easier.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-09 13:38:50 +00:00
Yuxuan Shui 60c10790d7
new glx: initial implementation
This is basically just adapting old code to the new interface. A lot
of the functions are still stubs, but the basic stuffs is working.

What remains to be done:

* Implement gl_image_op. (It should do the operation lazily, only update
the flags on the texture. Actual processing will be delayed until composition.)

* Implement gl_copy. Now it just return the same image after incrementing the
refcount. It should actually copy the image data structure so it can have a
separate set of flags.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-09 01:39:18 +00:00
Yuxuan Shui f2aeb848ec
Put the whole vtable in backend_list
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-07 21:08:51 +00:00
Yuxuan Shui eed5ea719e
Implement monitor repaint in new xrender
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-05 20:27:10 +00:00
Yuxuan Shui c387a266dc
backend interface: prepare is optional
Also remove xrender's prepare since it overwrite part of the screen
outside the damage region, causing rendering problems.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-05 20:27:10 +00:00
Yuxuan Shui c57f267535
backend interface: Add visible hint
Pass the visible region of the image to the backend, so the backend
could optimize based on that information.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-03-04 23:02:58 +00: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 b0c5db9f5a
Let old/new backends co-exist
Now both the old and the new backends are compiled in, the user can
choose which one to use with a command line switch.

Lower the barrier for testing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-02-20 17:52:24 +00:00
Yuxuan Shui 5364c8ac9b
Add backend_info_t::max_buffer_age
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-27 19:45:40 +00:00
Yuxuan Shui d92a546beb
Fix includes and typos in new backends 2019-01-27 19:34:26 +00:00
Yuxuan Shui b50f15c835
Adapt paint_all_new to new interface
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-27 19:29:02 +00:00
Yuxuan Shui 916e23861a
Improve the header includes, cont'd
Also check in the modulemap file, and add a option to build with clang's
-fmodules.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-20 17:10:06 +00:00
Yuxuan Shui 72e3468694
Add backend_info_t::buffer_age
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-08 21:32:54 +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 6d3ea3564b
Implement vsync for the new xrender backend
We use the Present extension for that, since it is the best option we
have.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-01-01 14:59:56 +00:00
Yuxuan Shui edb1139507
Add some comments to backend.h
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2018-12-31 23:30:45 +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