mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
stage: Make the API take a CoglTexture
MetaCursorReference doesn't really need to be part of the API.
This commit is contained in:
parent
c7fa446ee7
commit
30953cf2d7
@ -53,15 +53,18 @@ queue_redraw (MetaCursorRenderer *renderer)
|
|||||||
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
|
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
|
||||||
MetaBackend *backend = meta_get_backend ();
|
MetaBackend *backend = meta_get_backend ();
|
||||||
ClutterActor *stage = meta_backend_get_stage (backend);
|
ClutterActor *stage = meta_backend_get_stage (backend);
|
||||||
|
CoglTexture *texture;
|
||||||
|
|
||||||
/* During early initialization, we can have no stage */
|
/* During early initialization, we can have no stage */
|
||||||
if (!stage)
|
if (!stage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (priv->handled_by_backend)
|
if (priv->displayed_cursor && !priv->handled_by_backend)
|
||||||
meta_stage_set_cursor (META_STAGE (stage), NULL, &priv->current_rect);
|
texture = meta_cursor_reference_get_cogl_texture (priv->displayed_cursor, NULL, NULL);
|
||||||
else
|
else
|
||||||
meta_stage_set_cursor (META_STAGE (stage), priv->displayed_cursor, &priv->current_rect);
|
texture = NULL;
|
||||||
|
|
||||||
|
meta_stage_set_cursor (META_STAGE (stage), texture, &priv->current_rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -184,20 +184,14 @@ queue_redraw_for_overlay (MetaStage *stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_stage_set_cursor (MetaStage *stage,
|
meta_stage_set_cursor (MetaStage *stage,
|
||||||
MetaCursorReference *cursor,
|
CoglTexture *texture,
|
||||||
MetaRectangle *rect)
|
MetaRectangle *rect)
|
||||||
{
|
{
|
||||||
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
|
||||||
CoglTexture *texture;
|
|
||||||
|
|
||||||
g_assert (meta_is_wayland_compositor ());
|
g_assert (meta_is_wayland_compositor ());
|
||||||
|
|
||||||
if (cursor)
|
|
||||||
texture = meta_cursor_reference_get_cogl_texture (cursor, NULL, NULL);
|
|
||||||
else
|
|
||||||
texture = NULL;
|
|
||||||
|
|
||||||
meta_overlay_set (&priv->cursor_overlay, texture, rect);
|
meta_overlay_set (&priv->cursor_overlay, texture, rect);
|
||||||
queue_redraw_for_overlay (stage, &priv->cursor_overlay);
|
queue_redraw_for_overlay (stage, &priv->cursor_overlay);
|
||||||
}
|
}
|
||||||
|
@ -51,9 +51,9 @@ GType meta_stage_get_type (void) G_GNUC_CONST;
|
|||||||
|
|
||||||
ClutterActor *meta_stage_new (void);
|
ClutterActor *meta_stage_new (void);
|
||||||
|
|
||||||
void meta_stage_set_cursor (MetaStage *stage,
|
void meta_stage_set_cursor (MetaStage *stage,
|
||||||
MetaCursorReference *cursor,
|
CoglTexture *texture,
|
||||||
MetaRectangle *rect);
|
MetaRectangle *rect);
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* META_STAGE_H */
|
#endif /* META_STAGE_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user