mirror of
https://github.com/brl/mutter.git
synced 2025-06-13 16:59:30 +00:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user