Commit Graph

13 Commits

Author SHA1 Message Date
Matthias Clasen
0c67b367ac subsurface: Tweak the attach implementation
Do the backend call before changing the stacking order in the
frontend. This is necessary so the backend can look at the current
stacking order to determine if it will change.
2024-04-15 19:53:46 -04:00
Matthias Clasen
d563d158c0 subsurface: Add gdk_subsurface_get_sibling
This was just a missing getter. The backend implementation will
use this information to determine whether stacking changes.
2024-04-15 19:53:46 -04:00
Matthias Clasen
933a0e5a98 subsurface: Some api revision and documentation
Rename things so they make more sense. The dest/source naming got
a bit unclear when we added background into the mix. Now we're going
for:

source_rect - the texture region to display
texture_rect - dimensions of the subsurface showing the texture
background_rect - dimensions of the background subsurface
bounds - union of texture_rect and background_rect

Also use this opportunity to add some api docs.
2024-04-15 19:53:46 -04:00
Matthias Clasen
3f9bdaa4c8 Add background to subsurfaces
Make it possible for subsurfaces to have a black background on a
secondary subsurface below the actual subsurface. Using a single-pixel
buffer for that background increases the changes that the compositor
will use direct scanout for the actual subsurface.

This changes the private subsurface API. All callers have been
updated to pass an empty background rect.
2024-04-15 19:53:46 -04:00
Matthias Clasen
1c8b22cf05 subsurface: Cosmetics 2024-04-15 19:53:46 -04:00
Matthias Clasen
72e9f30937 subsurface: Add transforms
Allow to specify a D₂ transform when attaching a texture to a
subsurface, to handle flipped and rotated content. The Wayland
implementation handles these transforms by setting a buffer
transform on the subsurface.

All callers have been updated to pass GDK_TEXTURE_TRANSFORM_NORMAL.
2024-04-07 11:02:40 -04:00
Matthias Clasen
9a30ea1f69 subsurface: Have a source rectangle
This will let us use a subset of the full texture, which can
be necessary in the case that converters put padding around
content in dmabufs. The naming follows the Wayland viewporter
spec.

For now, make all callers pass the full texture rect.
2024-02-11 21:44:27 -05:00
Matthias Clasen
0495359eca subsurface: Rename rect to dest
We are going to introduce another rect, so better to be clear in
naming. We are following the naming of the Wayland viewporter spec
and call the rectangle that we drawing into the dest(ination).
2024-02-11 21:43:51 -05:00
Matthias Clasen
cefa09f74f gdk: Add another assertion
Bad things happen if you attach a subsurface above itself, so
catch that case.
2024-02-07 17:41:38 -05:00
Matthias Clasen
d823502af7 Fix subsurface stacking
This wasn't working :(
2024-02-07 16:23:51 -05:00
Matthias Clasen
eaf944938b surface: Keep subsurface stacking order
It is useful for us to know this, in particular the topmost
subsurface, to determine the right dmabuf formats.
2024-02-07 12:38:18 -05:00
Matthias Clasen
160fa969d4 subsurface: Replace place_above/below
Instead, do it all in attach(), which becomes more and more like
ConfigureWindow. This is good, because it will let us take the
above-ness into account when making decisions about attaching.
2023-11-21 13:24:04 -05:00
Matthias Clasen
223e27e7dc gdk: Add private subsurface api
Add api to allow creating subsurfaces, attaching textures to them,
and changing the stacking order.

This is just the api, there is no implementation yet.
2023-11-13 22:17:35 +01:00