wl_surface/wl_subsurface composition
Pekka Paalanen
ppaalanen at gmail.com
Wed Dec 11 10:27:15 UTC 2019
On Wed, 11 Dec 2019 08:46:54 +0100
Martin Stransky <stransky at redhat.com> wrote:
> Hi guys,
>
> while solving a Firefox Wayland bug [1] I wonder if there's any
> composition between a surface and a subsurface on compositor side
> (namely mutter) when the subsurface area is subset of the surface and
> the surface is set as opaque.
>
> Both surface and subsurface are using ARGB pixel format.
Aside from the other replies which are correct, you can also think of
it from this side:
A wl_subsurface is a role for wl_surface, so even a sub-surface will
always use a wl_surface. Every wl_surface gets a wl_buffer from the
client separately. Given that, the compositor will have one buffer for
the parent surface and another buffer for the sub-surface, and it must
use both to realize the scene. So there is no way even in theory to
avoid the composition of these in the compositor.
But, the composition can be realized by any means, e.g. by putting each
buffer into a hardware overlay directly when possible (Mutter does not
yet implement this AFAIK).
You may want to specify more clearly what you mean by "composition":
the general concept that includes also hardware overlays and zero-copy
paths, or specifically a copy path where the client buffers are read and
copied/blended into another buffer.
It is undefined whether a Wayland compositor will create an
intermediate composition of a sub-surface tree before compositing that
into the actual framebuffer. Weston does not, Mutter I'm not sure, and
in any case you don't need to know and should not care. Just
concentrate on giving as accurate and correct surface information as
you can to the compositor (opaque regions included), and the compositor
will do the optimal thing based on those.
Thanks,
pq
>
> Thanks,
> Martin
>
> [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1591489#c9
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20191211/abfc266f/attachment.sig>
More information about the wayland-devel
mailing list