Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Introduce wlr_client_buffer #2043

Merged
merged 1 commit into from
Mar 6, 2020
Merged

Conversation

emersion
Copy link
Member

@emersion emersion commented Feb 28, 2020

Split out the client/resource handling out of wlr_buffer by introducing
wlr_client_buffer. Make wlr_buffer an interface so that compositors can
create their own wlr_buffers (e.g. backed by GBM, like glider 1).

Should we move wlr_client_buffer to its own header file?


This is a breaking change. Compositors that don't directly use wlr_buffer shouldn't need an update. For compositors which use it directly:

  • wlr_buffer has been renamed to wlr_client_buffer
  • wlr_buffer_{ref,unref,get_dmabuf} and wlr_output_attach_buffer still take a wlr_buffer, compositors need to use &wlr_client_buffer->base
  • wlr_buffer_create and wlr_buffer_apply_damage have been renamed to wlr_client_buffer_create and wlr_client_buffer_apply_damage
  • wlr_buffer_get_resource_size has been renamed to wlr_resource_get_buffer_size

Sway PR: swaywm/sway#5049

@emersion emersion added the breaking Breaking change in public API label Feb 28, 2020
emersion added a commit to emersion/sway that referenced this pull request Feb 28, 2020
Update for breaking changes in [1].

[1]: swaywm/wlroots#2043
emersion added a commit to emersion/glider that referenced this pull request Feb 28, 2020
Update for [1].

Rename glider_wlr_buffer to glider_client_buffer, since the only
use-case for importing a wlr_buffer is to get access to client buffers.

[1]: swaywm/wlroots#2043
Split out the client/resource handling out of wlr_buffer by introducing
wlr_client_buffer. Make wlr_buffer an interface so that compositors can
create their own wlr_buffers (e.g. backed by GBM, like glider [1]).

[1]: https://github.com/emersion/glider/blob/c66847dd1cf8ae5e68666ce7cb3be41427b38dc7/include/gbm_allocator.h#L7
@ddevault
Copy link
Contributor

Does this make #1910 obsolete?

@emersion
Copy link
Member Author

emersion commented Feb 28, 2020

No. #1910 allows compositors to register additional client buffer types, this PR is about compositor buffer types (such as buffers directly allocated via GBM). So these two PRs are orthogonal.

With this PR, #1910 should probably define wlr_client_buffer_impl instead of wlr_buffer_impl.

@ddevault ddevault merged commit 8afc1ed into swaywm:master Mar 6, 2020
@ddevault
Copy link
Contributor

ddevault commented Mar 6, 2020

Thanks! Nice work.

emersion added a commit to emersion/sway that referenced this pull request Mar 6, 2020
Update for breaking changes in [1].

[1]: swaywm/wlroots#2043
ddevault pushed a commit to swaywm/sway that referenced this pull request Mar 6, 2020
Update for breaking changes in [1].

[1]: swaywm/wlroots#2043
emersion added a commit to emersion/glider that referenced this pull request Mar 8, 2020
Update for [1].

Rename glider_wlr_buffer to glider_client_buffer, since the only
use-case for importing a wlr_buffer is to get access to client buffers.

[1]: swaywm/wlroots#2043
emersion added a commit to emersion/rootston that referenced this pull request Mar 10, 2020
@emersion emersion added this to the 0.11.0 milestone Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

2 participants