wayland: implement HW cursors

Use the DRM API and libgbm to upload cursor buffers to the
appropriate HW plane, saving on GL calls and compositing.

https://bugzilla.gnome.org/show_bug.cgi?id=707573
This commit is contained in:
Giovanni Campagna
2013-09-05 16:45:41 +02:00
parent 65db8efbe8
commit a3e44d13d1
5 changed files with 587 additions and 81 deletions

View File

@ -77,7 +77,7 @@ pointer_unmap_sprite (MetaWaylandSeat *seat)
{
if (seat->cursor_tracker)
{
meta_cursor_tracker_set_sprite (seat->cursor_tracker,
meta_cursor_tracker_set_buffer (seat->cursor_tracker,
NULL, 0, 0);
if (seat->current_stage)
@ -95,29 +95,20 @@ pointer_unmap_sprite (MetaWaylandSeat *seat)
void
meta_wayland_seat_update_sprite (MetaWaylandSeat *seat)
{
ClutterBackend *backend;
CoglContext *context;
struct wl_resource *buffer;
CoglTexture2D *texture;
if (seat->cursor_tracker == NULL)
return;
backend = clutter_get_default_backend ();
context = clutter_backend_get_cogl_context (backend);
buffer = seat->sprite->buffer_ref.buffer->resource;
texture = cogl_wayland_texture_2d_new_from_buffer (context, buffer, NULL);
meta_cursor_tracker_set_sprite (seat->cursor_tracker,
texture,
meta_cursor_tracker_set_buffer (seat->cursor_tracker,
buffer,
seat->hotspot_x,
seat->hotspot_y);
if (seat->current_stage)
meta_cursor_tracker_queue_redraw (seat->cursor_tracker,
CLUTTER_ACTOR (seat->current_stage));
cogl_object_unref (texture);
}
static void