[PATCH weston] libweston: don't accumulate damage from transparent views
Pekka Paalanen
ppaalanen at gmail.com
Thu Apr 19 09:11:09 UTC 2018
On Wed, 18 Apr 2018 15:44:26 +0200
Emre Ucan <eucan at de.adit-jv.com> wrote:
> If view is set to be entirely transparent,
> there is no need to accumulate its damage.
>
> This is an important optimization for
> using view transparency. Because otherwise
> transparent views are rendered like an
> opaque view, and their pixel values
> are set to 0 in fragment shader.
>
> Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
> ---
> libweston/compositor.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libweston/compositor.c b/libweston/compositor.c
> index a9de4ac..4bcf120 100644
> --- a/libweston/compositor.c
> +++ b/libweston/compositor.c
> @@ -2122,7 +2122,10 @@ compositor_accumulate_damage(struct weston_compositor *ec)
> pixman_region32_init(&opaque);
>
> wl_list_for_each(ev, &ec->view_list, link) {
> - if (ev->plane != plane)
> + /* If view is set to be entirely transparent,
> + * there is no need to accumulate its damage.
> + */
> + if (ev->plane != plane || ev->alpha == 0.0f)
> continue;
>
> view_accumulate_damage(ev, &opaque);
Hi,
why this instead of removing the whole view from the scenegraph?
You would also need to exclude the view in
weston_compositor_pick_view(), and adding these rendering special cases
around doesn't feel very good to me.
Thanks,
pq
-------------- 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/20180419/d663c32b/attachment.sig>
More information about the wayland-devel
mailing list