mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-07 00:05:32 +00:00
compositor: turn weston_view boundingbox into masked
weston_view::transform.boundingbox is made to include the layer mask, which removes the need for masked_boundingbox. The following were using boundingbox when they should have used masked_boundingbox: - drm_output_prepare_overlay_view() uses boundingbox to compute overlay position, source and destination coordinates. - drm_assign_planes() uses boundingbox for view overlap checks. - is_view_not_visible() uses boundingbox, but nothing will show outside the layer mask. - weston_surface_assign_output() intersects boundingbox with output region to choose the primary output for a surface. - weston_view_assign_output() intersects boundingbox with output region to pick the outputs the view is on. This patch essentially changes all those cases to use the masked boundingbox. Therefore there are no cases which would need the boundingbox without the layer mask, and we can convert boundingbox into masked and remove the left-over member. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> [v2: don't move the decl of 'mask' in weston_view_update_transform] Reviewed-By: Giulio Camuffo <giuliocamuffo@gmail.com>
This commit is contained in:
parent
8844bf2ab0
commit
25c0ca5715
|
@ -443,7 +443,6 @@ weston_view_create(struct weston_surface *surface)
|
|||
wl_list_init(&view->layer_link.link);
|
||||
|
||||
pixman_region32_init(&view->clip);
|
||||
pixman_region32_init(&view->transform.masked_boundingbox);
|
||||
|
||||
view->alpha = 1.0;
|
||||
pixman_region32_init(&view->transform.opaque);
|
||||
|
@ -964,7 +963,7 @@ weston_view_damage_below(struct weston_view *view)
|
|||
pixman_region32_t damage;
|
||||
|
||||
pixman_region32_init(&damage);
|
||||
pixman_region32_subtract(&damage, &view->transform.masked_boundingbox,
|
||||
pixman_region32_subtract(&damage, &view->transform.boundingbox,
|
||||
&view->clip);
|
||||
if (view->plane)
|
||||
pixman_region32_union(&view->plane->damage,
|
||||
|
@ -1234,8 +1233,8 @@ weston_view_update_transform(struct weston_view *view)
|
|||
layer = get_view_layer(view);
|
||||
if (layer) {
|
||||
pixman_region32_init_with_extents(&mask, &layer->mask);
|
||||
pixman_region32_intersect(&view->transform.masked_boundingbox,
|
||||
&view->transform.boundingbox, &mask);
|
||||
pixman_region32_intersect(&view->transform.boundingbox,
|
||||
&view->transform.boundingbox, &mask);
|
||||
pixman_region32_intersect(&view->transform.opaque,
|
||||
&view->transform.opaque, &mask);
|
||||
pixman_region32_fini(&mask);
|
||||
|
@ -1538,8 +1537,7 @@ weston_compositor_pick_view(struct weston_compositor *compositor,
|
|||
wl_list_for_each(view, &compositor->view_list, link) {
|
||||
weston_view_from_global_fixed(view, x, y, vx, vy);
|
||||
if (pixman_region32_contains_point(
|
||||
&view->transform.masked_boundingbox,
|
||||
ix, iy, NULL) &&
|
||||
&view->transform.boundingbox, ix, iy, NULL) &&
|
||||
pixman_region32_contains_point(&view->surface->input,
|
||||
wl_fixed_to_int(*vx),
|
||||
wl_fixed_to_int(*vy),
|
||||
|
@ -1632,7 +1630,6 @@ weston_view_destroy(struct weston_view *view)
|
|||
|
||||
pixman_region32_fini(&view->clip);
|
||||
pixman_region32_fini(&view->transform.boundingbox);
|
||||
pixman_region32_fini(&view->transform.masked_boundingbox);
|
||||
pixman_region32_fini(&view->transform.opaque);
|
||||
|
||||
weston_view_set_transform_parent(view, NULL);
|
||||
|
|
|
@ -793,7 +793,6 @@ struct weston_view {
|
|||
|
||||
pixman_region32_t boundingbox;
|
||||
pixman_region32_t opaque;
|
||||
pixman_region32_t masked_boundingbox;
|
||||
|
||||
/* matrix and inverse are used only if enabled = 1.
|
||||
* If enabled = 0, use x, y, width, height directly.
|
||||
|
|
|
@ -604,7 +604,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
|
|||
|
||||
pixman_region32_init(&repaint);
|
||||
pixman_region32_intersect(&repaint,
|
||||
&ev->transform.masked_boundingbox, damage);
|
||||
&ev->transform.boundingbox, damage);
|
||||
pixman_region32_subtract(&repaint, &repaint, &ev->clip);
|
||||
|
||||
if (!pixman_region32_not_empty(&repaint))
|
||||
|
|
|
@ -398,7 +398,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
|
|||
|
||||
pixman_region32_init(&repaint);
|
||||
pixman_region32_intersect(&repaint,
|
||||
&ev->transform.masked_boundingbox, damage);
|
||||
&ev->transform.boundingbox, damage);
|
||||
pixman_region32_subtract(&repaint, &repaint, &ev->clip);
|
||||
|
||||
if (!pixman_region32_not_empty(&repaint))
|
||||
|
|
Loading…
Reference in a new issue