mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 08:58:08 +02:00
Clip out pixels covered by opaque surfaces during repaint
This commit is contained in:
parent
9cd7aca0e0
commit
cfc6d27b4c
1 changed files with 21 additions and 1 deletions
|
|
@ -492,7 +492,7 @@ wlsc_output_repaint(struct wlsc_output *output)
|
|||
struct wlsc_compositor *ec = output->compositor;
|
||||
struct wlsc_surface *es;
|
||||
struct wlsc_input_device *eid;
|
||||
pixman_region32_t new_damage, total_damage;
|
||||
pixman_region32_t new_damage, total_damage, repaint;
|
||||
|
||||
output->prepare_render(output);
|
||||
|
||||
|
|
@ -520,6 +520,18 @@ wlsc_output_repaint(struct wlsc_output *output)
|
|||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
wlsc_surface_draw(es, output, &total_damage);
|
||||
} else {
|
||||
wl_list_for_each(es, &ec->surface_list, link) {
|
||||
if (es->visual != &ec->compositor.rgb_visual)
|
||||
continue;
|
||||
|
||||
pixman_region32_init_rect(&repaint,
|
||||
es->x, es->y,
|
||||
es->width, es->height);
|
||||
wlsc_surface_draw(es, output, &total_damage);
|
||||
pixman_region32_subtract(&total_damage,
|
||||
&total_damage, &repaint);
|
||||
}
|
||||
|
||||
if (output->background)
|
||||
wlsc_surface_draw(output->background,
|
||||
output, &total_damage);
|
||||
|
|
@ -531,6 +543,14 @@ wlsc_output_repaint(struct wlsc_output *output)
|
|||
ec->switcher->current == es)
|
||||
continue;
|
||||
|
||||
if (es->visual == &ec->compositor.rgb_visual) {
|
||||
pixman_region32_union_rect(&total_damage,
|
||||
&total_damage,
|
||||
es->x, es->y,
|
||||
es->width, es->height);
|
||||
continue;
|
||||
}
|
||||
|
||||
wlsc_surface_draw(es, output, &total_damage);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue