[gtk/wip/baedert/gl-rework] cssimage: Remove _gtk_css_image_draw



commit 2faa44e3b19e8d3cc3a892599569c72531cad15d
Author: Timm Bäder <mail baedert org>
Date:   Mon Jan 20 10:35:55 2020 +0100

    cssimage: Remove _gtk_css_image_draw
    
    Inline it into the only caller, which is also in gtkcssimage.c

 gtk/gtkcssimage.c        | 42 ++++++++++++------------------------------
 gtk/gtkcssimageprivate.h |  4 ----
 2 files changed, 12 insertions(+), 34 deletions(-)
---
diff --git a/gtk/gtkcssimage.c b/gtk/gtkcssimage.c
index 3179031f9a..750d310309 100644
--- a/gtk/gtkcssimage.c
+++ b/gtk/gtkcssimage.c
@@ -245,35 +245,6 @@ _gtk_css_image_equal (GtkCssImage *image1,
   return klass->equal (image1, image2);
 }
 
-void
-_gtk_css_image_draw (GtkCssImage        *image,
-                     cairo_t            *cr,
-                     double              width,
-                     double              height)
-{
-  GtkSnapshot *snapshot;
-  GskRenderNode *node;
-
-  gtk_internal_return_if_fail (GTK_IS_CSS_IMAGE (image));
-  gtk_internal_return_if_fail (cr != NULL);
-  gtk_internal_return_if_fail (width > 0);
-  gtk_internal_return_if_fail (height > 0);
-
-  cairo_save (cr);
-
-  snapshot = gtk_snapshot_new ();
-  gtk_css_image_snapshot (image, snapshot, width, height);
-  node = gtk_snapshot_free_to_node (snapshot);
-
-  if (node != NULL)
-    {
-      gsk_render_node_draw (node, cr);
-      gsk_render_node_unref (node);
-    }
-
-  cairo_restore (cr);
-}
-
 void
 gtk_css_image_snapshot (GtkCssImage *image,
                         GtkSnapshot *snapshot,
@@ -475,6 +446,8 @@ _gtk_css_image_get_surface (GtkCssImage     *image,
                             int              surface_height)
 {
   cairo_surface_t *result;
+  GtkSnapshot *snapshot;
+  GskRenderNode *node;
   cairo_t *cr;
 
   gtk_internal_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
@@ -492,7 +465,16 @@ _gtk_css_image_get_surface (GtkCssImage     *image,
                                          surface_height);
 
   cr = cairo_create (result);
-  _gtk_css_image_draw (image, cr, surface_width, surface_height);
+  snapshot = gtk_snapshot_new ();
+  gtk_css_image_snapshot (image, snapshot, surface_width, surface_height);
+  node = gtk_snapshot_free_to_node (snapshot);
+
+  if (node != NULL)
+    {
+      gsk_render_node_draw (node, cr);
+      gsk_render_node_unref (node);
+    }
+
   cairo_destroy (cr);
 
   return result;
diff --git a/gtk/gtkcssimageprivate.h b/gtk/gtkcssimageprivate.h
index b467112e6e..e8d9e10d3d 100644
--- a/gtk/gtkcssimageprivate.h
+++ b/gtk/gtkcssimageprivate.h
@@ -113,10 +113,6 @@ GtkCssImage *  _gtk_css_image_transition           (GtkCssImage                *
                                                     guint                       property_id,
                                                     double                      progress);
 
-void           _gtk_css_image_draw                 (GtkCssImage                *image,
-                                                    cairo_t                    *cr,
-                                                    double                      width,
-                                                    double                      height);
 void           gtk_css_image_snapshot              (GtkCssImage                *image,
                                                     GtkSnapshot                *snapshot,
                                                     double                      width,


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