forked from AuroraMiddleware/gtk
glarea: Stop using gtk_snapshot_render api
The gtk_snapshot_render api is deprecated, stop using it.
This commit is contained in:
parent
dd3c371c08
commit
484cff2182
@ -29,7 +29,9 @@
|
|||||||
#include "gtksnapshot.h"
|
#include "gtksnapshot.h"
|
||||||
#include "gtknative.h"
|
#include "gtknative.h"
|
||||||
#include "gtkwidgetprivate.h"
|
#include "gtkwidgetprivate.h"
|
||||||
#include "deprecated/gtkrender.h"
|
#include "gtksnapshot.h"
|
||||||
|
#include "gtkrenderlayoutprivate.h"
|
||||||
|
#include "gtkcssnodeprivate.h"
|
||||||
|
|
||||||
#include <epoxy/gl.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);
|
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
|
||||||
PangoLayout *layout;
|
PangoLayout *layout;
|
||||||
int layout_height;
|
int layout_height;
|
||||||
|
GtkCssBoxes boxes;
|
||||||
|
|
||||||
layout = gtk_widget_create_pango_layout (GTK_WIDGET (area),
|
layout = gtk_widget_create_pango_layout (GTK_WIDGET (area), priv->error->message);
|
||||||
priv->error->message);
|
|
||||||
pango_layout_set_width (layout, width * PANGO_SCALE);
|
pango_layout_set_width (layout, width * PANGO_SCALE);
|
||||||
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
|
pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
|
||||||
pango_layout_get_pixel_size (layout, NULL, &layout_height);
|
pango_layout_get_pixel_size (layout, NULL, &layout_height);
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
gtk_css_boxes_init (&boxes, GTK_WIDGET (area));
|
||||||
gtk_snapshot_render_layout (snapshot,
|
gtk_css_style_snapshot_layout (&boxes, snapshot, 0, (height - layout_height) / 2, layout);
|
||||||
gtk_widget_get_style_context (GTK_WIDGET (area)),
|
|
||||||
0, (height - layout_height) / 2,
|
|
||||||
layout);
|
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
|
||||||
|
|
||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user