p[2] = c;
wl_surface_damage(touch->surface, x - 2, y - 2, 5, 5);
+ /* todo: We could queue up more damage before committing, if there
+ * are more input events to handle.
+ */
+ wl_surface_commit(touch->surface);
}
static void
surface->pending.buffer_destroy_listener.notify =
surface_handle_pending_buffer_destroy;
+ pixman_region32_init(&surface->pending.damage);
return surface;
}
if (weston_surface_is_mapped(surface))
weston_surface_unmap(surface);
+ pixman_region32_fini(&surface->pending.damage);
+
if (surface->pending.buffer)
wl_list_remove(&surface->pending.buffer_destroy_listener.link);
struct wl_resource *resource,
int32_t x, int32_t y, int32_t width, int32_t height)
{
- struct weston_surface *es = resource->data;
+ struct weston_surface *surface = resource->data;
- pixman_region32_union_rect(&es->damage, &es->damage,
+ pixman_region32_union_rect(&surface->pending.damage,
+ &surface->pending.damage,
x, y, width, height);
- weston_surface_schedule_repaint(es);
}
static void
if (surface->buffer && surface->configure)
surface->configure(surface, surface->pending.sx,
surface->pending.sy);
+
+ /* wl_surface.damage */
+ pixman_region32_union(&surface->damage, &surface->damage,
+ &surface->pending.damage);
+ empty_region(&surface->pending.damage);
+ weston_surface_schedule_repaint(surface);
}
static const struct wl_surface_interface surface_interface = {