Commit Graph

47 Commits

Author SHA1 Message Date
Simon Ser 23e37e7b1d output: refactor frame submission API
This is necessary for direct scan-out and other upcoming features. This patch
changes the output API to look like the wl_surface API.

Outputs now have some double-buffered state: the frame to be submitted
(currently only wlr_renderer frames are supported) and the damaged region.
To attach a pending frame, use wlr_output_attach_render. To set the pending
damaged region, use wlr_output_set_damage.

To submit the pending state, call wlr_output_commit. This will submit the
pending frame to the backend.

To migrate from the old API to the new one:

- Replace wlr_output_make_current calls by wlr_output_attach_render
- Replace wlr_output_swap_buffers calls by wlr_output_set_damage and
  wlr_output_commit
2019-04-23 14:34:30 -06:00
random human 7105864e13
Handle setting keymap in examples more securely 2018-09-03 02:43:44 +05:30
emersion f86f1daf9a Fix build on FreeBSD 2018-08-16 10:54:45 +01:00
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
Tobias Blass 75f9feb6de Fix double-free in the rotation.c example.
The wl_display_destroy function already destroys the backend's renderer.
Freeing it by hand causes a segmentation fault.
2018-05-30 01:12:34 +02:00
Ilia Bozhinov 24cf70ae96 backends: implement custom EGL and renderer initialization
Compositors now have more control over how the backend creates its
renderer. Currently all backends create an EGL/GLES2 renderer, so
the necessary attributes for creating the context are passed to a
user-provided callback function. It is responsible for initializing
provided wlr_egl and to return a renderer. On fail, return 0.

Fixes #987
2018-05-25 14:56:52 +03:00
Timidger 9a1d0e42d2
Fixed emersion's issues 2018-05-10 19:03:58 -07:00
Timidger 7da50d065b
Fixed style issues 2018-05-10 19:03:58 -07:00
Timidger 7f1230fe78
Remvoed unnecessary wayland socket in examples 2018-05-10 19:03:57 -07:00
Timidger b510c0f6c2
Made rotation example standalone 2018-05-10 19:03:57 -07:00
Timidger ad6d40c7c6
Moved cat out of support, removed support 2018-05-10 19:03:56 -07:00
emersion f63a5d881d
examples: get wlr_renderer from the backend 2018-04-01 16:57:29 -04:00
emersion 33a2eb4b77
Untie wlr_backend from wlr_renderer 2018-03-31 18:49:43 -04:00
emersion c63d94483b
Redesign wlr_texture
- Textures are now immutable (apart from those created from raw
  pixels), no more invalid textures
- Move all wl_drm stuff in wlr_renderer
- Most of wlr_texture fields are now private
- Remove some duplicated DMA-BUF code in the DRM backend
- Add more assertions
- Stride is now always given as bytes rather than pixels
- Drop wl_shm functions

Fun fact: this patch has been written 10,000 meters up in the air.
2018-03-24 23:48:32 -04:00
emersion 3581573bdc
render/gles2: make wlr_renderer_begin take viewport size
This allows raw GL calls outside wlr_renderer to be removed.
2018-03-21 07:37:09 +01:00
emersion c41de2d1be
render: split render.h into wlr_renderer.h and wlr_texture.h 2018-03-19 23:16:29 +01:00
emersion 876f07e9f1
renderer: replace wlr_texture_get_matrix by wlr_render_texture 2018-03-15 19:31:02 +01:00
emersion 824a95ad19
matrix: use 2D matrices 2018-03-15 15:33:58 +01:00
emersion d26b67cb06
matrix: unify API, don't use array pointers 2018-03-15 11:10:56 +01:00
emersion b6a3f240c7
matrix: move to types/ 2018-03-15 09:11:27 +01:00
Guido Günther d08792bfff Add alpha to wlr_render_with_matrix
so we can use the alpha channel to e.g. blend in textures
2018-02-25 13:47:48 +01:00
emersion ddb1779f9f
render: make wlr_renderer_clear take a float[4] for the color 2018-02-03 09:32:02 +01:00
emersion 415a2b7c56
render: add wlr_renderer_clear and wlr_renderer_scissor 2018-01-22 16:42:22 +01:00
emersion 59c53e8333
Merge remote-tracking branch 'upstream/master' into output-damage 2018-01-21 22:18:06 +01:00
Johannes Schramm dcc743047b style: include brackets for if/while/for, even if it's a single statement 2018-01-21 16:28:21 +01:00
emersion 0365b587f0
output: add damage tracking via buffer age 2018-01-21 00:06:35 +01:00
emersion e29a0df8c1
output: fix software cursors damage tracking 2018-01-19 14:08:47 +01:00
Timidger 264ef0c261
Fixed logging for examples 2018-01-15 22:51:00 -05:00
emersion 3b4b8953d9
Update output layout when scale or transform changes 2017-12-12 21:58:00 +01:00
Drew DeVault 4f73498b78 Move shared example code 2017-11-01 15:47:58 -04:00
Drew DeVault f4387b437f Merge branch 'master' into rootston 2017-09-25 08:29:51 -04:00
Drew DeVault 61e451ea1b Move keyboard logic to wlr_{keyboard,seat} 2017-09-24 14:12:56 -04:00
Tony Crisci cef1f60522 wlr-seat-keyboard: basic events 2017-09-22 16:28:11 -04:00
Tony Crisci 54f87146c3 refactor example config and add ini.c 2017-08-26 08:32:11 -04:00
Dominique Martinet 5885679e33 examples: separate compositor_fini from run
compositor_fini destroys the display, but it is an error to destroy it
before e.g. wlr_seat that references it.
This lets us order destroy calls properly, following first-in-last-out
logic.
2017-08-19 09:31:06 +02:00
Dominique Martinet f24b3df980 wlr renderer/texture: rename init to create when it does alloc 2017-08-19 08:33:31 +02:00
Tony Crisci 769549c652 Refactor example output config
Put all the config parsing into shared.h so it is shared among the examples.
2017-08-18 17:44:10 -04:00
nyorain ad22b4874d Fix wlr_seat; add to example compositor 2017-08-17 13:06:53 +02:00
Calvin Lee 5cc7342606 Prevent alloc errors from crashing
Resolves #76
2017-08-15 08:04:57 +02:00
Drew DeVault c24351681f Refactor EGL handling 2017-08-10 22:15:37 -04:00
nyorain 1901c3e1b6 Fix example for updated gles 2017-08-10 11:03:58 +02:00
nyorain 67369173aa Implement drm (egl) buffer attaching 2017-08-10 10:59:58 +02:00
nyorain e167f41fde Rename wlr_surface -> wlr_texture; attach -> upload 2017-08-08 18:25:16 +02:00
Scott Anderson cb4d50e22c Changed header paths. 2017-08-06 13:25:26 +12:00
Scott Anderson 8189c64d7f Fixed that warnings that showed up with optimisations. 2017-07-11 00:14:55 +12:00
Drew DeVault 8920b5d607 Merge branch 'wlcore' 2017-06-29 16:00:24 -04:00
Drew DeVault 28736c5787 Move example -> examples
And the compositor example into its own directory
2017-06-28 18:23:49 -04:00
Renamed from example/rotation.c (Browse further)