[gtk/deprecate-render: 38/54] glarea: Stop using gtk_snapshot_render api




commit 8600768f3fe603c81e68ef9034d33dc468709335
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 8 14:28:41 2022 -0400

    glarea: Stop using gtk_snapshot_render api
    
    The gtk_snapshot_render api is deprecated, stop using it.

 gtk/gtkglarea.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 2810ed0c1a..110accdcf3 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -29,7 +29,9 @@
 #include "gtksnapshot.h"
 #include "gtknative.h"
 #include "gtkwidgetprivate.h"
-#include "deprecated/gtkrender.h"
+#include "gtksnapshot.h"
+#include "gtkrenderlayoutprivate.h"
+#include "gtkcssnodeprivate.h"
 
 #include <epoxy/gl.h>
 
@@ -653,19 +655,15 @@ gtk_gl_area_draw_error_screen (GtkGLArea   *area,
   GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
   PangoLayout *layout;
   int layout_height;
+  GtkCssBoxes boxes;
 
-  layout = gtk_widget_create_pango_layout (GTK_WIDGET (area),
-                                           priv->error->message);
+  layout = gtk_widget_create_pango_layout (GTK_WIDGET (area), priv->error->message);
   pango_layout_set_width (layout, width * PANGO_SCALE);
   pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
   pango_layout_get_pixel_size (layout, NULL, &layout_height);
 
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-  gtk_snapshot_render_layout (snapshot,
-                              gtk_widget_get_style_context (GTK_WIDGET (area)),
-                              0, (height - layout_height) / 2,
-                              layout);
-G_GNUC_END_IGNORE_DEPRECATIONS
+  gtk_css_boxes_init (&boxes, GTK_WIDGET (area));
+  gtk_css_style_snapshot_layout (&boxes, snapshot, 0, (height - layout_height) / 2, layout);
 
   g_object_unref (layout);
 }


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