[gnome-shell] shell/util: Remove get_content_for_window_actor()



commit 483d1b3177a8b35599b5825b4ac51a105b360c08
Author: Robert Mader <robert mader posteo de>
Date:   Wed Jun 9 21:18:21 2021 +0200

    shell/util: Remove get_content_for_window_actor()
    
    It got replaced by `meta_window_actor_paint_to_content()`.
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1879>

 src/shell-util.c | 55 -------------------------------------------------------
 src/shell-util.h |  3 ---
 2 files changed, 58 deletions(-)
---
diff --git a/src/shell-util.c b/src/shell-util.c
index 0bc3f4d65b..bdbfe83913 100644
--- a/src/shell-util.c
+++ b/src/shell-util.c
@@ -354,61 +354,6 @@ shell_util_create_pixbuf_from_data (const guchar      *data,
 
 typedef const gchar *(*ShellGLGetString) (GLenum);
 
-static gboolean
-canvas_draw_cb (ClutterContent *content,
-                cairo_t        *cr,
-                gint            width,
-                gint            height,
-                gpointer        user_data)
-{
-  cairo_surface_t *surface = user_data;
-
-  cairo_set_source_surface (cr, surface, 0, 0);
-  cairo_paint (cr);
-
-  return FALSE;
-}
-
-/**
- * shell_util_get_content_for_window_actor:
- * @window_actor: a #MetaWindowActor
- * @window_rect: a #MetaRectangle
- *
- * Returns: (transfer full) (nullable): a new #ClutterContent
- */
-ClutterContent *
-shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
-                                         MetaRectangle   *window_rect)
-{
-  ClutterContent *content;
-  cairo_surface_t *surface;
-  cairo_rectangle_int_t clip;
-  gfloat actor_x, actor_y;
-
-  clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
-
-  clip.x = window_rect->x - (gint) actor_x;
-  clip.y = window_rect->y - (gint) actor_y;
-  clip.width = window_rect->width;
-  clip.height = window_rect->height;
-
-  surface = meta_window_actor_get_image (window_actor, &clip);
-
-  if (!surface)
-    return NULL;
-
-  content = clutter_canvas_new ();
-  clutter_canvas_set_size (CLUTTER_CANVAS (content),
-                           cairo_image_surface_get_width (surface),
-                           cairo_image_surface_get_height (surface));
-  g_signal_connect (content, "draw",
-                    G_CALLBACK (canvas_draw_cb), surface);
-  clutter_content_invalidate (content);
-  cairo_surface_destroy (surface);
-
-  return content;
-}
-
 cairo_surface_t *
 shell_util_composite_capture_images (ClutterCapture  *captures,
                                      int              n_captures,
diff --git a/src/shell-util.h b/src/shell-util.h
index d0de033f61..04485b99c1 100644
--- a/src/shell-util.h
+++ b/src/shell-util.h
@@ -46,9 +46,6 @@ GdkPixbuf *shell_util_create_pixbuf_from_data (const guchar      *data,
                                                int                height,
                                                int                rowstride);
 
-ClutterContent * shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
-                                                          MetaRectangle   *window_rect);
-
 cairo_surface_t * shell_util_composite_capture_images (ClutterCapture  *captures,
                                                        int              n_captures,
                                                        int              x,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]