[mutter] stage: Make the API take a CoglTexture
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] stage: Make the API take a CoglTexture
- Date: Thu, 21 Aug 2014 21:22:32 +0000 (UTC)
commit 30953cf2d7b4ceac4621a78813920a5a57ca37de
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Aug 21 15:00:03 2014 -0400
stage: Make the API take a CoglTexture
MetaCursorReference doesn't really need to be part of the API.
src/backends/meta-cursor-renderer.c | 9 ++++++---
src/backends/meta-stage.c | 12 +++---------
src/backends/meta-stage.h | 6 +++---
3 files changed, 12 insertions(+), 15 deletions(-)
---
diff --git a/src/backends/meta-cursor-renderer.c b/src/backends/meta-cursor-renderer.c
index 67f92e5..176e6af 100644
--- a/src/backends/meta-cursor-renderer.c
+++ b/src/backends/meta-cursor-renderer.c
@@ -53,15 +53,18 @@ queue_redraw (MetaCursorRenderer *renderer)
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
MetaBackend *backend = meta_get_backend ();
ClutterActor *stage = meta_backend_get_stage (backend);
+ CoglTexture *texture;
/* During early initialization, we can have no stage */
if (!stage)
return;
- if (priv->handled_by_backend)
- meta_stage_set_cursor (META_STAGE (stage), NULL, &priv->current_rect);
+ if (priv->displayed_cursor && !priv->handled_by_backend)
+ texture = meta_cursor_reference_get_cogl_texture (priv->displayed_cursor, NULL, NULL);
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
diff --git a/src/backends/meta-stage.c b/src/backends/meta-stage.c
index d331ec1..7f50a20 100644
--- a/src/backends/meta-stage.c
+++ b/src/backends/meta-stage.c
@@ -184,20 +184,14 @@ queue_redraw_for_overlay (MetaStage *stage,
}
void
-meta_stage_set_cursor (MetaStage *stage,
- MetaCursorReference *cursor,
- MetaRectangle *rect)
+meta_stage_set_cursor (MetaStage *stage,
+ CoglTexture *texture,
+ MetaRectangle *rect)
{
MetaStagePrivate *priv = meta_stage_get_instance_private (stage);
- CoglTexture *texture;
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);
queue_redraw_for_overlay (stage, &priv->cursor_overlay);
}
diff --git a/src/backends/meta-stage.h b/src/backends/meta-stage.h
index df11feb..742d14f 100644
--- a/src/backends/meta-stage.h
+++ b/src/backends/meta-stage.h
@@ -51,9 +51,9 @@ GType meta_stage_get_type (void) G_GNUC_CONST;
ClutterActor *meta_stage_new (void);
-void meta_stage_set_cursor (MetaStage *stage,
- MetaCursorReference *cursor,
- MetaRectangle *rect);
+void meta_stage_set_cursor (MetaStage *stage,
+ CoglTexture *texture,
+ MetaRectangle *rect);
G_END_DECLS
#endif /* META_STAGE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]