snapshot: Rename append APIs

Instead of having gtk_snapshot_append_foo_node(), just have
gtk_snapshot_append_foo(). Nobody needs to know that this internally
uses nodes.
This commit is contained in:
Benjamin Otte 2017-01-13 04:46:09 +01:00
parent e5e5beafa5
commit 6055028c96
32 changed files with 205 additions and 203 deletions

View File

@ -4465,9 +4465,9 @@ gtk_snapshot_set_transform
gtk_snapshot_transform
gtk_snapshot_translate_2d
gtk_snapshot_append_node
gtk_snapshot_append_cairo_node
gtk_snapshot_append_texture_node
gtk_snapshot_append_color_node
gtk_snapshot_append_cairo
gtk_snapshot_append_texture
gtk_snapshot_append_color
gtk_snapshot_clips_rect
gtk_snapshot_render_background
gtk_snapshot_render_frame

View File

@ -229,7 +229,7 @@
to a cairo surface. Instead, they have a snapshot() function that creates
one or more GskRenderNodes to represent their content. Third-party widgets
that use a draw() function or a #GtkWidget::draw signal handler for custom
drawing will need to be converted to use gtk_snapshot_append_cairo_node().
drawing will need to be converted to use gtk_snapshot_append_cairo().
</para>
<para>
The auxiliary #GtkSnapshot object has APIs to help with creating render

View File

@ -2588,13 +2588,13 @@ calendar_snapshot_day (GtkCalendar *calendar,
gtk_style_context_get_color (context, &color);
gtk_snapshot_append_color_node (snapshot,
&color,
&GRAPHENE_RECT_INIT (
day_rect.x + 2, y_loc,
day_rect.width - 2, 1
),
"CalendarDetailSeparator");
gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT (
day_rect.x + 2, y_loc,
day_rect.width - 2, 1
),
"CalendarDetailSeparator");
y_loc += 2;
}

View File

@ -756,13 +756,13 @@ gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
if (priv->cell_background_set && !selected)
{
gtk_snapshot_append_color_node (snapshot,
&priv->cell_background,
&GRAPHENE_RECT_INIT (
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellBackground");
gtk_snapshot_append_color (snapshot,
&priv->cell_background,
&GRAPHENE_RECT_INIT (
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellBackground");
}
gtk_snapshot_push_clip (snapshot,

View File

@ -417,12 +417,12 @@ gtk_cell_renderer_spinner_snapshot (GtkCellRenderer *cellr,
if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect))
return;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (
cell_area->x, cell_area->y,
cell_area->width, cell_area->height
),
"CellSpinner");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (
cell_area->x, cell_area->y,
cell_area->width, cell_area->height
),
"CellSpinner");
gtk_paint_spinner (gtk_widget_get_style_context (widget),
cr,

View File

@ -1735,13 +1735,13 @@ gtk_cell_renderer_text_snapshot (GtkCellRenderer *cell,
if (priv->background_set && (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
gtk_snapshot_append_color_node (snapshot,
&priv->background,
&GRAPHENE_RECT_INIT(
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellTextBackground");
gtk_snapshot_append_color (snapshot,
&priv->background,
&GRAPHENE_RECT_INIT(
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellTextBackground");
}
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);

View File

@ -80,9 +80,9 @@ plane_snapshot (GtkWidget *widget,
width = gtk_widget_get_allocated_width (widget);
height = gtk_widget_get_allocated_height (widget);
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"ColorPlane");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"ColorPlane");
cairo_set_source_surface (cr, plane->priv->surface, 0, 0);
cairo_paint (cr);

View File

@ -67,9 +67,9 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
if (width <= 1 || height <= 1)
return;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT(x, y, width, height),
"ColorScaleTrough");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT(x, y, width, height),
"ColorScaleTrough");
cairo_translate (cr, x, y);
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&

View File

@ -143,9 +143,9 @@ gtk_color_swatch_render (GtkCssGadget *gadget,
{
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&content_box.bounds,
"CheckeredBackground");
cr = gtk_snapshot_append_cairo (snapshot,
&content_box.bounds,
"CheckeredBackground");
cairo_set_source_rgb (cr, 0.33, 0.33, 0.33);
cairo_paint (cr);
@ -159,10 +159,10 @@ gtk_color_swatch_render (GtkCssGadget *gadget,
cairo_destroy (cr);
gtk_snapshot_append_color_node (snapshot,
&swatch->priv->color,
&content_box.bounds,
"ColorSwatch Color");
gtk_snapshot_append_color (snapshot,
&swatch->priv->color,
&content_box.bounds,
"ColorSwatch Color");
}
else
{
@ -170,10 +170,10 @@ gtk_color_swatch_render (GtkCssGadget *gadget,
color.alpha = 1.0;
gtk_snapshot_append_color_node (snapshot,
&color,
&content_box.bounds,
"ColorSwatch Opaque Color");
gtk_snapshot_append_color (snapshot,
&color,
&content_box.bounds,
"ColorSwatch Opaque Color");
}
gtk_snapshot_pop (snapshot);

View File

@ -126,9 +126,9 @@ gtk_css_image_real_snapshot (GtkCssImage *image,
{
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"Fallback<%s>", G_OBJECT_TYPE_NAME (image));
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"Fallback<%s>", G_OBJECT_TYPE_NAME (image));
_gtk_css_image_draw (image, cr, width, height);
cairo_destroy (cr);
}

View File

@ -662,9 +662,9 @@ gtk_css_image_builtin_snapshot (GtkCssImage *image,
return;
}
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"BuiltinImage<%d>", (int) image_type);
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"BuiltinImage<%d>", (int) image_type);
gtk_css_image_builtin_draw (image, cr, width, height, image_type);
cairo_destroy (cr);
}

View File

@ -79,7 +79,7 @@ gtk_css_image_fallback_snapshot (GtkCssImage *image,
else
color = &red;
gtk_snapshot_append_color_node (snapshot, color, &GRAPHENE_RECT_INIT (0, 0, width, height), "image() Fallback Color");
gtk_snapshot_append_color (snapshot, color, &GRAPHENE_RECT_INIT (0, 0, width, height), "image() Fallback Color");
}
else
gtk_css_image_snapshot (fallback->images[fallback->used], snapshot, width, height);

View File

@ -86,15 +86,15 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
texture_width = (double) gdk_pixbuf_get_width (pixbuf) / icon_theme->scale;
texture_height = (double) gdk_pixbuf_get_height (pixbuf) / icon_theme->scale;
gtk_snapshot_append_texture_node (snapshot,
texture,
&GRAPHENE_RECT_INIT(
(width - texture_width) / 2.0,
(height - texture_height) / 2.0,
texture_width,
texture_height
),
"CssImageIconTheme<%s@%d>", icon_theme->name, icon_theme->scale);
gtk_snapshot_append_texture (snapshot,
texture,
&GRAPHENE_RECT_INIT(
(width - texture_width) / 2.0,
(height - texture_height) / 2.0,
texture_width,
texture_height
),
"CssImageIconTheme<%s@%d>", icon_theme->name, icon_theme->scale);
g_object_unref (texture);
g_object_unref (pixbuf);

View File

@ -187,10 +187,10 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
* get the color of the last color stop */
GtkCssImageLinearColorStop *stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, linear->stops->len - 1);
gtk_snapshot_append_color_node (snapshot,
_gtk_css_rgba_value_get_rgba (stop->color),
&GRAPHENE_RECT_INIT (0, 0, width, height),
"RepeatingLinearGradient<degenerate>");
gtk_snapshot_append_color (snapshot,
_gtk_css_rgba_value_get_rgba (stop->color),
&GRAPHENE_RECT_INIT (0, 0, width, height),
"RepeatingLinearGradient<degenerate>");
return;
}

View File

@ -56,12 +56,12 @@ gtk_css_image_surface_snapshot (GtkCssImage *image,
if (surface->texture == NULL)
return;
gtk_snapshot_append_texture_node (snapshot,
surface->texture,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"Surface Image %dx%d",
gsk_texture_get_width (surface->texture),
gsk_texture_get_height (surface->texture));
gtk_snapshot_append_texture (snapshot,
surface->texture,
&GRAPHENE_RECT_INIT (0, 0, width, height),
"Surface Image %dx%d",
gsk_texture_get_width (surface->texture),
gsk_texture_get_height (surface->texture));
}
static void

View File

@ -284,10 +284,10 @@ gtk_debug_updates_snapshot (GtkWidget *widget,
for (i = 0; i < cairo_region_num_rectangles (draw->region); i++)
{
cairo_region_get_rectangle (draw->region, i, &rect);
gtk_snapshot_append_color_node (snapshot,
&(GdkRGBA) { 1, 0, 0, 0.4 * (1 - progress) },
&GRAPHENE_RECT_INIT(rect.x, rect.y, rect.width, rect.height),
"Debug Updates<%g>", progress);
gtk_snapshot_append_color (snapshot,
&(GdkRGBA) { 1, 0, 0, 0.4 * (1 - progress) },
&GRAPHENE_RECT_INIT(rect.x, rect.y, rect.width, rect.height),
"Debug Updates<%g>", progress);
}
}
}

View File

@ -239,11 +239,13 @@ gtk_drawing_area_snapshot (GtkWidget *widget,
if (!priv->draw_func)
return;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget)),
"DrawingAreaContents");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (
0, 0,
gtk_widget_get_allocated_width (widget),
gtk_widget_get_allocated_height (widget)
),
"DrawingAreaContents");
priv->draw_func (self,
cr,
gtk_widget_get_allocated_width (widget),

View File

@ -3601,12 +3601,12 @@ gtk_entry_render (GtkCssGadget *gadget,
gtk_css_gadget_snapshot (priv->progress_gadget, snapshot);
/* Draw text and cursor */
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (x + priv->text_x,
y,
priv->text_width,
height),
"Entry Text");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (x + priv->text_x,
y,
priv->text_width,
height),
"Entry Text");
if (priv->dnd_position != -1)
gtk_entry_draw_cursor (GTK_ENTRY (widget), cr, CURSOR_DND);

View File

@ -2560,9 +2560,9 @@ gtk_flow_box_render (GtkCssGadget *gadget,
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (x, y, width, height),
"FlowBox Rubberband");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (x, y, width, height),
"FlowBox Rubberband");
context = gtk_widget_get_style_context (widget);
gtk_style_context_save_to_node (context, priv->rubberband_node);

View File

@ -4236,9 +4236,9 @@ gtk_label_render (GtkCssGadget *gadget,
range_clip = gdk_pango_layout_get_clip_region (priv->layout, lx, ly, range, 1);
cairo_region_get_extents (range_clip, &clip_extents);
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_FROM_RECT (&clip_extents),
"Selected Text");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_FROM_RECT (&clip_extents),
"Selected Text");
gtk_style_context_save_to_node (context, info->selection_node);
gdk_cairo_region (cr, range_clip);
@ -4286,9 +4286,9 @@ gtk_label_render (GtkCssGadget *gadget,
range_clip = gdk_pango_layout_get_clip_region (priv->layout, lx, ly, range, 1);
cairo_region_get_extents (range_clip, &clip_extents);
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_FROM_RECT(&clip_extents),
"Active Link");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_FROM_RECT(&clip_extents),
"Active Link");
gdk_cairo_region (cr, range_clip);
cairo_clip (cr);
cairo_region_destroy (range_clip);

View File

@ -1127,9 +1127,9 @@ gtk_popover_snapshot (GtkWidget *widget,
graphene_rect_init (&bounds,
clip.x - allocation.x, clip.y - allocation.y,
clip.width, clip.height);
cr = gtk_snapshot_append_cairo_node (snapshot,
&bounds,
"Popover");
cr = gtk_snapshot_append_cairo (snapshot,
&bounds,
"Popover");
/* Render the rect background */
gtk_render_background (context, cr,
rect_x, rect_y,

View File

@ -91,20 +91,20 @@ gtk_theming_background_snapshot_color (GtkThemingBackground *bg,
if (gsk_rounded_rect_is_rectilinear (&bg->boxes[clip]))
{
gtk_snapshot_append_color_node (snapshot,
bg_color,
&bg->boxes[clip].bounds,
"BackgroundColor");
gtk_snapshot_append_color (snapshot,
bg_color,
&bg->boxes[clip].bounds,
"BackgroundColor");
}
else
{
gtk_snapshot_push_rounded_clip (snapshot,
&bg->boxes[clip],
"BackgroundColorClip");
gtk_snapshot_append_color_node (snapshot,
bg_color,
&bg->boxes[clip].bounds,
"BackgroundColor");
gtk_snapshot_append_color (snapshot,
bg_color,
&bg->boxes[clip].bounds,
"BackgroundColor");
gtk_snapshot_pop (snapshot);
}
}

View File

@ -589,9 +589,9 @@ snapshot_frame_stroke (GtkSnapshot *snapshot,
double double_width[4] = { border_width[0], border_width[1], border_width[2], border_width[3] };
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&outline->bounds,
"BorderStroke");
cr = gtk_snapshot_append_cairo (snapshot,
&outline->bounds,
"BorderStroke");
render_frame_stroke (cr, outline, double_width, colors, hidden_side, stroke_style);
cairo_destroy (cr);
}
@ -941,9 +941,9 @@ gtk_css_style_snapshot_border (GtkCssStyle *style,
{
double double_width[4] = { border_width[0], border_width[1], border_width[2], border_width[3] };
cr = gtk_snapshot_append_cairo_node (snapshot,
&bounds,
"Border Image");
cr = gtk_snapshot_append_cairo (snapshot,
&bounds,
"Border Image");
gtk_border_image_render (&border_image, double_width, cr, 0, 0, width, height);
cairo_destroy (cr);
}

View File

@ -305,7 +305,7 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style,
0, 0,
gsk_texture_get_width (texture) / texture_scale,
gsk_texture_get_height (texture) / texture_scale);
gtk_snapshot_append_texture_node (snapshot, texture, &bounds, "Icon");
gtk_snapshot_append_texture (snapshot, texture, &bounds, "Icon");
}
else
{
@ -320,7 +320,7 @@ gtk_css_style_snapshot_icon_texture (GtkCssStyle *style,
gtk_snapshot_push_transform (snapshot, &matrix, "Icon Transform");
graphene_rect_init (&bounds, 0, 0, gsk_texture_get_width (texture), gsk_texture_get_height (texture));
gtk_snapshot_append_texture_node (snapshot, texture, &bounds, "Icon");
gtk_snapshot_append_texture (snapshot, texture, &bounds, "Icon");
gtk_snapshot_pop (snapshot);
}

View File

@ -1758,15 +1758,15 @@ gtk_scale_render_mark_indicator (GtkCssGadget *gadget,
gtk_style_context_get_color (context, &color);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
gtk_snapshot_append_color_node (snapshot,
&color,
&GRAPHENE_RECT_INIT(x + width / 2, y, 1, height),
"ScaleMark");
gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT(x + width / 2, y, 1, height),
"ScaleMark");
else
gtk_snapshot_append_color_node (snapshot,
&color,
&GRAPHENE_RECT_INIT(x, y + height / 2, width, 1),
"ScaleMark");
gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT(x, y + height / 2, width, 1),
"ScaleMark");
gtk_style_context_restore (context);

View File

@ -40,7 +40,7 @@
* a cairo context, and maintains a stack of render nodes and their associated
* transformations.
*
* The node at the top of the stack is the the one that gtk_snapshot_append_node()
* The node at the top of the stack is the the one that gtk_snapshot_append()
* operates on. Use the gtk_snapshot_push() and gtk_snapshot_pop() functions to
* change the current node.
*
@ -987,10 +987,10 @@ gtk_snapshot_translate_2d (GtkSnapshot *snapshot,
*
* Use this offset to determine how to offset nodes that you
* manually add to the snapshot using
* gtk_snapshot_append_node().
* gtk_snapshot_append().
*
* Note that other functions that add nodes for you, such as
* gtk_snapshot_append_cairo_node() will add this offset for
* gtk_snapshot_append_cairo() will add this offset for
* you.
**/
void
@ -1033,7 +1033,7 @@ gtk_snapshot_append_node (GtkSnapshot *snapshot,
}
/**
* gtk_snapshot_append_cairo_node:
* gtk_snapshot_append_cairo:
* @snapshot: a #GtkSnapshot
* @bounds: the bounds for the new node
* @name: (transfer none): a printf() style format string for the name for the new node
@ -1048,10 +1048,10 @@ gtk_snapshot_append_node (GtkSnapshot *snapshot,
* Since: 3.90
*/
cairo_t *
gtk_snapshot_append_cairo_node (GtkSnapshot *snapshot,
const graphene_rect_t *bounds,
const char *name,
...)
gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
const graphene_rect_t *bounds,
const char *name,
...)
{
GskRenderNode *node;
graphene_rect_t real_bounds;
@ -1088,7 +1088,7 @@ gtk_snapshot_append_cairo_node (GtkSnapshot *snapshot,
}
/**
* gtk_snapshot_append_texture_node:
* gtk_snapshot_append_texture:
* @snapshot: a #GtkSnapshot
* @texture: the #GskTexture to render
* @bounds: the bounds for the new node
@ -1099,11 +1099,11 @@ gtk_snapshot_append_cairo_node (GtkSnapshot *snapshot,
* to the current render node of @snapshot.
**/
void
gtk_snapshot_append_texture_node (GtkSnapshot *snapshot,
GskTexture *texture,
const graphene_rect_t *bounds,
const char *name,
...)
gtk_snapshot_append_texture (GtkSnapshot *snapshot,
GskTexture *texture,
const graphene_rect_t *bounds,
const char *name,
...)
{
GskRenderNode *node;
graphene_rect_t real_bounds;
@ -1134,7 +1134,7 @@ gtk_snapshot_append_texture_node (GtkSnapshot *snapshot,
}
/**
* gtk_snapshot_append_color_node:
* gtk_snapshot_append_color:
* @snapshot: a #GtkSnapshot
* @color: the #GdkRGBA to draw
* @bounds: the bounds for the new node
@ -1147,11 +1147,11 @@ gtk_snapshot_append_texture_node (GtkSnapshot *snapshot,
* You should try to avoid calling this function if @color is transparent.
**/
void
gtk_snapshot_append_color_node (GtkSnapshot *snapshot,
const GdkRGBA *color,
const graphene_rect_t *bounds,
const char *name,
...)
gtk_snapshot_append_color (GtkSnapshot *snapshot,
const GdkRGBA *color,
const graphene_rect_t *bounds,
const char *name,
...)
{
GskRenderNode *node;
graphene_rect_t real_bounds;
@ -1193,7 +1193,7 @@ gtk_snapshot_append_color_node (GtkSnapshot *snapshot,
* Since: 3.90
*/
gboolean
gtk_snapshot_clips_rect (GtkSnapshot *snapshot,
gtk_snapshot_clips_rect (GtkSnapshot *snapshot,
const cairo_rectangle_int_t *rect)
{
cairo_rectangle_int_t offset_rect;
@ -1352,7 +1352,7 @@ gtk_snapshot_render_layout (GtkSnapshot *snapshot,
gtk_snapshot_translate_2d (snapshot, x, y);
cr = gtk_snapshot_append_cairo_node (snapshot, &bounds, "Text<%dchars>", pango_layout_get_character_count (layout));
cr = gtk_snapshot_append_cairo (snapshot, &bounds, "Text<%dchars>", pango_layout_get_character_count (layout));
_gtk_css_shadows_value_paint_layout (shadow, cr, layout);

View File

@ -105,18 +105,18 @@ GDK_AVAILABLE_IN_3_90
void gtk_snapshot_append_node (GtkSnapshot *snapshot,
GskRenderNode *node);
GDK_AVAILABLE_IN_3_90
cairo_t * gtk_snapshot_append_cairo_node (GtkSnapshot *snapshot,
cairo_t * gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
const graphene_rect_t *bounds,
const char *name,
...) G_GNUC_PRINTF(3, 4);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_append_texture_node (GtkSnapshot *snapshot,
void gtk_snapshot_append_texture (GtkSnapshot *snapshot,
GskTexture *texture,
const graphene_rect_t *bounds,
const char *name,
...) G_GNUC_PRINTF (4, 5);
GDK_AVAILABLE_IN_3_90
void gtk_snapshot_append_color_node (GtkSnapshot *snapshot,
void gtk_snapshot_append_color (GtkSnapshot *snapshot,
const GdkRGBA *color,
const graphene_rect_t *bounds,
const char *name,

View File

@ -2123,9 +2123,9 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
cairo_t *cr;
get_insertion_cursor_bounds (height, direction, draw_arrow, &bounds);
cr = gtk_snapshot_append_cairo_node (snapshot,
&bounds,
"%s Cursor", is_primary ? "Primary" : "Secondary");
cr = gtk_snapshot_append_cairo (snapshot,
&bounds,
"%s Cursor", is_primary ? "Primary" : "Secondary");
draw_insertion_cursor (context, cr, 0, 0, height, is_primary, direction, draw_arrow);

View File

@ -4678,14 +4678,14 @@ gtk_tree_view_snapshot_line (GtkTreeView *tree_view,
GtkStyleContext *context;
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (
MIN (x1, x2),
MIN (y1, y2),
ABS (x2 - x1) + 1,
ABS (y2 - y1) + 1
),
"TreeViewGridLine");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (
MIN (x1, x2),
MIN (y1, y2),
ABS (x2 - x1) + 1,
ABS (y2 - y1) + 1
),
"TreeViewGridLine");
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
@ -5078,15 +5078,15 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
gtk_style_context_get_color (context, &color);
gtk_snapshot_append_color_node (snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_style_context_restore (context);
}
@ -5119,15 +5119,15 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
gtk_style_context_get_color (context, &color);
gtk_snapshot_append_color_node (snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_style_context_restore (context);
}
@ -14228,15 +14228,15 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
gtk_style_context_get_color (context, &color);
gtk_snapshot_append_color_node (&snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_snapshot_append_color (&snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
cell_area.y + cell_area.height / 2,
cell_area.x + cell_area.width,
1
),
"Separator");
gtk_style_context_restore (context);
}

View File

@ -15632,9 +15632,9 @@ gtk_widget_snapshot (GtkWidget *widget,
{
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&bounds, "Fallback<%s>",
G_OBJECT_TYPE_NAME (widget));
cr = gtk_snapshot_append_cairo (snapshot,
&bounds, "Fallback<%s>",
G_OBJECT_TYPE_NAME (widget));
gtk_widget_draw_internal (widget, cr, TRUE);
cairo_destroy (cr);
}
@ -15653,9 +15653,9 @@ gtk_widget_snapshot (GtkWidget *widget,
gboolean result;
cairo_t *cr;
cr = gtk_snapshot_append_cairo_node (snapshot,
&bounds,
"DrawSignalContents<%s>", G_OBJECT_TYPE_NAME (widget));
cr = gtk_snapshot_append_cairo (snapshot,
&bounds,
"DrawSignalContents<%s>", G_OBJECT_TYPE_NAME (widget));
g_signal_emit (widget, widget_signals[DRAW], 0, cr, &result);
cairo_destroy (cr);
}

View File

@ -195,12 +195,12 @@ gtk_cell_renderer_graph_snapshot (GtkCellRenderer *cell,
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_color (context, &color);
cr = gtk_snapshot_append_cairo_node (snapshot,
&GRAPHENE_RECT_INIT (
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellGraph");
cr = gtk_snapshot_append_cairo (snapshot,
&GRAPHENE_RECT_INIT (
background_area->x, background_area->y,
background_area->width, background_area->height
),
"CellGraph");
cairo_set_line_width (cr, 1.0);

View File

@ -236,9 +236,9 @@ gtk_render_node_view_snapshot (GtkWidget *widget,
height = gtk_widget_get_allocated_height (widget);
graphene_rect_init (&rect, 0, 0, width, height);
cr = gtk_snapshot_append_cairo_node (snapshot,
&rect,
"RenderNodeView");
cr = gtk_snapshot_append_cairo (snapshot,
&rect,
"RenderNodeView");
cairo_translate (cr, width / 2.0, height / 2.0);
if (width < viewport.width || height < viewport.height)