Commit Graph

63 Commits

Author SHA1 Message Date
Simon Zeni 6d6e70b9e0 examples: init wlr_output with allocator and renderer 2021-11-18 09:37:57 -05:00
Simon Zeni e192d87731 move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
Simon Ser fbc2182b9f Stop specifying xkb_rule_names
If a NULL xkb_rule_names pointer is passed to
xkb_keymap_new_from_names, libxkbcommon will default to reading
the XKB_* env variables. So there's no need to do it ourselves.

Also s/xkb_map_new_from_names/xkb_keymap_new_from_names/ since the
latter is more consistent with the returned struct name.

[1]: https://xkbcommon.org/doc/current/structxkb__rule__names.html
2021-04-19 17:33:28 +02:00
Simon Ser 83670fce65 examples: remove dependency on GLES2 for compositor examples
Most of the examples had a GLES2 dependency, but weren't using it.
Convert multi-pointer to wlr_renderer instead of using directly
glClear.
2021-04-19 17:32:07 +02:00
Simon Ser fd7e565ce3 examples: use wlr_output_preferred_mode 2021-04-19 17:25:41 +02:00
Simon Ser 675bc39658 Fix wl_shm_format passed to wlr_texture_from_pixels
Fixes: 27fba3df43 ("render: use DRM formats in wlr_texture_from_pixels")
2021-02-23 17:36:32 +01:00
Simon Ser 4b03bdc3ab Remove wlr_create_renderer_func_t
This callback allowed compositors to customize the EGL config used by
the renderer. However with renderer v6 EGL configs aren't used anymore.
Instead, buffers are allocated via GBM and GL FBOs are rendered to. So
customizing the EGL config is a no-op.
2020-12-30 17:09:40 +01:00
Isaac Freund 7693f61d81 Replace wlr_key_state with wl_keyboard_key_state
There's no reason to have duplicate enums
2020-11-11 10:58:38 +01:00
Scott Anderson 2fea2fced8 examples: Fix compositor-examples
Due to the way the wlr_output API was changed, these examples would
never get a frame event to start the rendering loop. We now commit the
outputs to start it.
2020-02-08 11:38:44 +01:00
Simon Ser 16e5e9541b Add -Wmissing-prototypes
This requires functions without a prototype definition to be static.
This allows to detect dead code, export less symbols and put shared
functions in headers.
2019-11-20 02:05:03 +00:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
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
emersion 2d0c5ec78e
Use _POSIX_C_SOURCE, use shm_open 2018-11-06 08:29:23 +01:00
random human ef5df78a27
Destroy layout after display in examples/output-layout 2018-09-03 03:27:28 +05:30
random human 7105864e13
Handle setting keymap in examples more securely 2018-09-03 02:43:44 +05:30
emersion 7cbef15206
util: add wlr_ prefix to log symbols 2018-07-09 22:49:54 +01:00
emersion 0c1f50168b
examples/output-layout: destroy wl_display
Thanks @tobiasblass for pointing this out. See #1017.
2018-05-30 08:34:49 +01: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 583654405f
Made output layout example standalone 2018-05-10 19:03:57 -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 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 1fe1d64042
Fix views outside output layout 2017-12-31 12:49:06 +01: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
Greg V a5fe9aa736 Add FreeBSD compatibility 2017-10-11 00:07:21 +03: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 e733b0e643 Rename wlr_output_layout_init()
Rename wlr_output_layout_init() to wlr_output_layout_create() to be consistent
with the rest of the api.
2017-09-05 17:53:29 -04:00
Tony Crisci 6d26fda57c use monotonic clock time for animations 2017-08-31 23:43:02 -04:00
Tony Crisci 35eee80f9b remove unused outputs list in output-layout.c 2017-08-31 07:47:44 -04:00
Tony Crisci fa3d4ecc84 fix layout hotplugging issue in output-layout.c 2017-08-31 07:47:44 -04:00
Tony Crisci f8e4ba3f5f cleanup output-layout example 2017-08-31 07:47:44 -04:00
Tony Crisci 40bd6bcc43 implement output layout auto configuration 2017-08-31 07:47:44 -04:00
Tony Crisci 54f87146c3 refactor example config and add ini.c 2017-08-26 08:32:11 -04:00