forked from AuroraMiddleware/gtk
snapshot: Redo debug messages
Instead of every snapshot function having debug messages, have an explicit gtk_snapshot_push_debug() function that appends a debug node.
This commit is contained in:
parent
49f9d2108d
commit
73b4a62f51
@ -68,8 +68,7 @@ plane_snapshot (GtkWidget *widget,
|
|||||||
height = gtk_widget_get_allocated_height (widget);
|
height = gtk_widget_get_allocated_height (widget);
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"FontPlane");
|
|
||||||
|
|
||||||
cairo_set_source_rgb (cr, 0, 0, 0);
|
cairo_set_source_rgb (cr, 0, 0, 0);
|
||||||
cairo_rectangle (cr, 0, 0, width, height);
|
cairo_rectangle (cr, 0, 0, width, height);
|
||||||
|
@ -102,8 +102,7 @@ drawing_area_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
allocation.width,
|
allocation.width,
|
||||||
allocation.height
|
allocation.height
|
||||||
),
|
));
|
||||||
"DrawingArea");
|
|
||||||
|
|
||||||
cairo_set_source_rgb (cr, 1, 1, 1);
|
cairo_set_source_rgb (cr, 1, 1, 1);
|
||||||
cairo_paint (cr);
|
cairo_paint (cr);
|
||||||
|
@ -56,15 +56,13 @@ gtk_nuclear_snapshot (GtkSnapshot *snapshot,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 },
|
&(GdkRGBA) { 0.9, 0.75, 0.15, 1.0 },
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"Yellow background");
|
|
||||||
|
|
||||||
size = MIN (width, height);
|
size = MIN (width, height);
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT ((width - size) / 2.0,
|
&GRAPHENE_RECT_INIT ((width - size) / 2.0,
|
||||||
(height - size) / 2.0,
|
(height - size) / 2.0,
|
||||||
size, size),
|
size, size));
|
||||||
"Radioactive Icon");
|
|
||||||
cairo_translate (cr, width / 2.0, height / 2.0);
|
cairo_translate (cr, width / 2.0, height / 2.0);
|
||||||
cairo_scale (cr, size, size);
|
cairo_scale (cr, size, size);
|
||||||
cairo_rotate (cr, rotation);
|
cairo_rotate (cr, rotation);
|
||||||
|
@ -23,6 +23,12 @@
|
|||||||
|
|
||||||
#include "gdksnapshotprivate.h"
|
#include "gdksnapshotprivate.h"
|
||||||
|
|
||||||
|
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
|
||||||
|
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
|
||||||
|
const char *message,
|
||||||
|
...) G_GNUC_PRINTF (2, 3);
|
||||||
|
void gtk_snapshot_pop (GdkSnapshot *snapshot);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:paintable
|
* SECTION:paintable
|
||||||
* @Title: GdkPaintable
|
* @Title: GdkPaintable
|
||||||
@ -206,8 +212,12 @@ gdk_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
if (width <= 0.0 || height <= 0.0)
|
if (width <= 0.0 || height <= 0.0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "%s %p @ %gx%g", G_OBJECT_TYPE_NAME (paintable), paintable, width, height);
|
||||||
|
|
||||||
iface = GDK_PAINTABLE_GET_IFACE (paintable);
|
iface = GDK_PAINTABLE_GET_IFACE (paintable);
|
||||||
iface->snapshot (paintable, snapshot, width, height);
|
iface->snapshot (paintable, snapshot, width, height);
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GDK_PAINTABLE_IMMUTABLE (GDK_PAINTABLE_STATIC_SIZE | GDK_PAINTABLE_STATIC_CONTENTS)
|
#define GDK_PAINTABLE_IMMUTABLE (GDK_PAINTABLE_STATIC_SIZE | GDK_PAINTABLE_STATIC_CONTENTS)
|
||||||
|
@ -47,9 +47,7 @@
|
|||||||
void
|
void
|
||||||
gtk_snapshot_append_texture (GdkSnapshot *snapshot,
|
gtk_snapshot_append_texture (GdkSnapshot *snapshot,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:gdktexture
|
* SECTION:gdktexture
|
||||||
@ -93,10 +91,7 @@ gdk_texture_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot,
|
gtk_snapshot_append_texture (snapshot,
|
||||||
self,
|
self,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"%s as paintable %dx%d",
|
|
||||||
G_OBJECT_TYPE_NAME (paintable),
|
|
||||||
self->width, self->height);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static GdkPaintableFlags
|
static GdkPaintableFlags
|
||||||
|
@ -46,7 +46,6 @@ struct _GskPangoRenderer
|
|||||||
GtkSnapshot *snapshot;
|
GtkSnapshot *snapshot;
|
||||||
GdkRGBA fg_color;
|
GdkRGBA fg_color;
|
||||||
graphene_rect_t bounds;
|
graphene_rect_t bounds;
|
||||||
char *name;
|
|
||||||
|
|
||||||
/* house-keeping options */
|
/* house-keeping options */
|
||||||
gboolean is_cached_renderer;
|
gboolean is_cached_renderer;
|
||||||
@ -147,13 +146,6 @@ gsk_pango_renderer_show_text_glyphs (PangoRenderer *renderer,
|
|||||||
if (node == NULL)
|
if (node == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (gtk_snapshot_get_record_names (crenderer->snapshot))
|
|
||||||
{
|
|
||||||
char *s = g_strdup_printf ("%s<%d>", crenderer->name, glyphs->num_glyphs);
|
|
||||||
gsk_render_node_set_name (node, s);
|
|
||||||
g_free (s);
|
|
||||||
}
|
|
||||||
|
|
||||||
gtk_snapshot_append_node_internal (crenderer->snapshot, node);
|
gtk_snapshot_append_node_internal (crenderer->snapshot, node);
|
||||||
gsk_render_node_unref (node);
|
gsk_render_node_unref (node);
|
||||||
}
|
}
|
||||||
@ -199,7 +191,7 @@ gsk_pango_renderer_draw_rectangle (PangoRenderer *renderer,
|
|||||||
(double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
|
(double)x / PANGO_SCALE, (double)y / PANGO_SCALE,
|
||||||
(double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
|
(double)width / PANGO_SCALE, (double)height / PANGO_SCALE);
|
||||||
|
|
||||||
gtk_snapshot_append_color (crenderer->snapshot, &rgba, &bounds, "DrawRectangle");
|
gtk_snapshot_append_color (crenderer->snapshot, &rgba, &bounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -216,7 +208,7 @@ gsk_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
gdouble x, y;
|
gdouble x, y;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds, "DrawTrapezoid");
|
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
|
||||||
|
|
||||||
set_color (crenderer, part, cr);
|
set_color (crenderer, part, cr);
|
||||||
|
|
||||||
@ -319,7 +311,7 @@ gsk_pango_renderer_draw_error_underline (PangoRenderer *renderer,
|
|||||||
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
|
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
|
||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds, "DrawTrapezoid");
|
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
|
||||||
|
|
||||||
set_color (crenderer, PANGO_RENDER_PART_UNDERLINE, cr);
|
set_color (crenderer, PANGO_RENDER_PART_UNDERLINE, cr);
|
||||||
|
|
||||||
@ -348,7 +340,7 @@ gsk_pango_renderer_draw_shape (PangoRenderer *renderer,
|
|||||||
double base_x = (double)x / PANGO_SCALE;
|
double base_x = (double)x / PANGO_SCALE;
|
||||||
double base_y = (double)y / PANGO_SCALE;
|
double base_y = (double)y / PANGO_SCALE;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds, "DrawShape");
|
cr = gtk_snapshot_append_cairo (crenderer->snapshot, &crenderer->bounds);
|
||||||
|
|
||||||
layout = pango_renderer_get_layout (renderer);
|
layout = pango_renderer_get_layout (renderer);
|
||||||
if (!layout)
|
if (!layout)
|
||||||
@ -419,7 +411,6 @@ release_renderer (GskPangoRenderer *renderer)
|
|||||||
if (G_LIKELY (renderer->is_cached_renderer))
|
if (G_LIKELY (renderer->is_cached_renderer))
|
||||||
{
|
{
|
||||||
renderer->snapshot = NULL;
|
renderer->snapshot = NULL;
|
||||||
g_clear_pointer (&renderer->name, g_free);
|
|
||||||
|
|
||||||
G_UNLOCK (cached_renderer);
|
G_UNLOCK (cached_renderer);
|
||||||
}
|
}
|
||||||
@ -432,19 +423,15 @@ release_renderer (GskPangoRenderer *renderer)
|
|||||||
* @snapshot: a #GtkSnapshot
|
* @snapshot: a #GtkSnapshot
|
||||||
* @layout: the #PangoLayout to render
|
* @layout: the #PangoLayout to render
|
||||||
* @color: the foreground color to render the layout in
|
* @color: the foreground color to render the layout in
|
||||||
* @name: (transfer none): a printf() style format string for the name for the new node
|
|
||||||
* @...: arguments to insert into the format string
|
|
||||||
*
|
*
|
||||||
* Creates render nodes for rendering @layout in the given foregound @color
|
* Creates render nodes for rendering @layout in the given foregound @color
|
||||||
* and appends them to the current node of @snapshot without changing the
|
* and appends them to the current node of @snapshot without changing the
|
||||||
* current node.
|
* current node.
|
||||||
**/
|
**/
|
||||||
void
|
void
|
||||||
gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
||||||
PangoLayout *layout,
|
PangoLayout *layout,
|
||||||
const GdkRGBA *color,
|
const GdkRGBA *color)
|
||||||
const char *name,
|
|
||||||
...)
|
|
||||||
{
|
{
|
||||||
GskPangoRenderer *crenderer;
|
GskPangoRenderer *crenderer;
|
||||||
PangoRectangle ink_rect;
|
PangoRectangle ink_rect;
|
||||||
@ -456,16 +443,6 @@ gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
|||||||
|
|
||||||
crenderer->snapshot = snapshot;
|
crenderer->snapshot = snapshot;
|
||||||
crenderer->fg_color = *color;
|
crenderer->fg_color = *color;
|
||||||
if (name && gtk_snapshot_get_record_names (crenderer->snapshot))
|
|
||||||
{
|
|
||||||
va_list args;
|
|
||||||
|
|
||||||
va_start (args, name);
|
|
||||||
crenderer->name = g_strdup_vprintf (name, args);
|
|
||||||
va_end (args);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
crenderer->name = NULL;
|
|
||||||
|
|
||||||
pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
|
pango_layout_get_pixel_extents (layout, &ink_rect, NULL);
|
||||||
graphene_rect_init (&crenderer->bounds, ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height);
|
graphene_rect_init (&crenderer->bounds, ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height);
|
||||||
|
@ -2325,8 +2325,7 @@ calendar_snapshot_day (GtkCalendar *calendar,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
day_rect.x + 2, y_loc,
|
day_rect.x + 2, y_loc,
|
||||||
day_rect.width - 2, 1
|
day_rect.width - 2, 1
|
||||||
),
|
));
|
||||||
"CalendarDetailSeparator");
|
|
||||||
|
|
||||||
y_loc += 2;
|
y_loc += 2;
|
||||||
}
|
}
|
||||||
|
@ -707,6 +707,8 @@ gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
|||||||
|
|
||||||
selected = (flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED;
|
selected = (flags & GTK_CELL_RENDERER_SELECTED) == GTK_CELL_RENDERER_SELECTED;
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "%s", G_OBJECT_TYPE_NAME (cell));
|
||||||
|
|
||||||
if (priv->cell_background_set && !selected)
|
if (priv->cell_background_set && !selected)
|
||||||
{
|
{
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
@ -714,16 +716,14 @@ gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
background_area->x, background_area->y,
|
background_area->x, background_area->y,
|
||||||
background_area->width, background_area->height
|
background_area->width, background_area->height
|
||||||
),
|
));
|
||||||
"CellBackground");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
background_area->x, background_area->y,
|
background_area->x, background_area->y,
|
||||||
background_area->width, background_area->height
|
background_area->width, background_area->height
|
||||||
),
|
));
|
||||||
"CellClip");
|
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
|
||||||
@ -741,6 +741,7 @@ gtk_cell_renderer_snapshot (GtkCellRenderer *cell,
|
|||||||
flags);
|
flags);
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -648,8 +648,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
clip.x, clip.y,
|
clip.x, clip.y,
|
||||||
clip.width, clip.height
|
clip.width, clip.height
|
||||||
),
|
));
|
||||||
"CellProgressClip");
|
|
||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_PROGRESSBAR);
|
||||||
@ -681,8 +680,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
clip.x, clip.y,
|
clip.x, clip.y,
|
||||||
clip.width, clip.height
|
clip.width, clip.height
|
||||||
),
|
));
|
||||||
"CellTroughClip");
|
|
||||||
|
|
||||||
gtk_snapshot_render_layout (snapshot, context,
|
gtk_snapshot_render_layout (snapshot, context,
|
||||||
x_pos, y_pos,
|
x_pos, y_pos,
|
||||||
@ -708,8 +706,7 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
clip.x, clip.y,
|
clip.x, clip.y,
|
||||||
clip.width, clip.height
|
clip.width, clip.height
|
||||||
),
|
));
|
||||||
"CellTroughClip");
|
|
||||||
|
|
||||||
gtk_snapshot_render_layout (snapshot, context,
|
gtk_snapshot_render_layout (snapshot, context,
|
||||||
x_pos, y_pos,
|
x_pos, y_pos,
|
||||||
|
@ -418,8 +418,7 @@ gtk_cell_renderer_spinner_snapshot (GtkCellRenderer *cellr,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
cell_area->x, cell_area->y,
|
cell_area->x, cell_area->y,
|
||||||
cell_area->width, cell_area->height
|
cell_area->width, cell_area->height
|
||||||
),
|
));
|
||||||
"CellSpinner");
|
|
||||||
|
|
||||||
gtk_paint_spinner (gtk_widget_get_style_context (widget),
|
gtk_paint_spinner (gtk_widget_get_style_context (widget),
|
||||||
cr,
|
cr,
|
||||||
|
@ -1730,8 +1730,7 @@ gtk_cell_renderer_text_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
background_area->x, background_area->y,
|
background_area->x, background_area->y,
|
||||||
background_area->width, background_area->height
|
background_area->width, background_area->height
|
||||||
),
|
));
|
||||||
"CellTextBackground");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
|
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
|
||||||
@ -1749,8 +1748,7 @@ gtk_cell_renderer_text_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
cell_area->x, cell_area->y,
|
cell_area->x, cell_area->y,
|
||||||
cell_area->width, cell_area->height
|
cell_area->width, cell_area->height
|
||||||
),
|
));
|
||||||
"CellTextClip");
|
|
||||||
|
|
||||||
gtk_snapshot_render_layout (snapshot, context,
|
gtk_snapshot_render_layout (snapshot, context,
|
||||||
cell_area->x + x_offset + xpad,
|
cell_area->x + x_offset + xpad,
|
||||||
|
@ -423,8 +423,7 @@ gtk_cell_renderer_toggle_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
cell_area->x, cell_area->y,
|
cell_area->x, cell_area->y,
|
||||||
cell_area->width, cell_area->height
|
cell_area->width, cell_area->height
|
||||||
),
|
));
|
||||||
"CellToggleClip");
|
|
||||||
|
|
||||||
context = gtk_cell_renderer_toggle_save_context (cell, widget);
|
context = gtk_cell_renderer_toggle_save_context (cell, widget);
|
||||||
gtk_style_context_set_state (context, state);
|
gtk_style_context_set_state (context, state);
|
||||||
|
@ -325,11 +325,10 @@ set_color_icon (GdkDragContext *context,
|
|||||||
GtkSnapshot *snapshot;
|
GtkSnapshot *snapshot;
|
||||||
GdkPaintable *paintable;
|
GdkPaintable *paintable;
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "ColorDragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
rgba,
|
rgba,
|
||||||
&GRAPHENE_RECT_INIT(0, 0, 48, 32),
|
&GRAPHENE_RECT_INIT(0, 0, 48, 32));
|
||||||
"ColorDragColor");
|
|
||||||
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
||||||
|
|
||||||
gtk_drag_set_icon_paintable (context, paintable, 0, 0);
|
gtk_drag_set_icon_paintable (context, paintable, 0, 0);
|
||||||
|
@ -84,11 +84,9 @@ plane_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot,
|
gtk_snapshot_append_texture (snapshot,
|
||||||
plane->priv->texture,
|
plane->priv->texture,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"ColorPlane");
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"ColorPlane");
|
|
||||||
|
|
||||||
cairo_move_to (cr, 0, y + 0.5);
|
cairo_move_to (cr, 0, y + 0.5);
|
||||||
cairo_line_to (cr, width, y + 0.5);
|
cairo_line_to (cr, width, y + 0.5);
|
||||||
|
@ -103,8 +103,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
|
|||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot,
|
gtk_snapshot_append_texture (snapshot,
|
||||||
texture,
|
texture,
|
||||||
&GRAPHENE_RECT_INIT(x, y, width, height),
|
&GRAPHENE_RECT_INIT(x, y, width, height));
|
||||||
"ColorScaleHue");
|
|
||||||
g_object_unref (texture);
|
g_object_unref (texture);
|
||||||
}
|
}
|
||||||
else if (scale->priv->type == GTK_COLOR_SCALE_ALPHA)
|
else if (scale->priv->type == GTK_COLOR_SCALE_ALPHA)
|
||||||
@ -113,8 +112,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
|
|||||||
graphene_point_t start, end;
|
graphene_point_t start, end;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT(x, y, width, height),
|
&GRAPHENE_RECT_INIT(x, y, width, height));
|
||||||
"ColorScaleAlpha");
|
|
||||||
cairo_translate (cr, x, y);
|
cairo_translate (cr, x, y);
|
||||||
|
|
||||||
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&
|
if (gtk_orientable_get_orientation (GTK_ORIENTABLE (widget)) == GTK_ORIENTATION_HORIZONTAL &&
|
||||||
@ -157,8 +155,7 @@ gtk_color_scale_snapshot_trough (GtkColorScale *scale,
|
|||||||
{ 0, { color->red, color->green, color->blue, 0 } },
|
{ 0, { color->red, color->green, color->blue, 0 } },
|
||||||
{ 1, { color->red, color->green, color->blue, 1 } },
|
{ 1, { color->red, color->green, color->blue, 1 } },
|
||||||
},
|
},
|
||||||
2,
|
2);
|
||||||
"ColorAlphaGradient");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,17 +117,13 @@ swatch_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget));
|
gtk_widget_get_height (widget));
|
||||||
gtk_snapshot_push_rounded_clip (snapshot,
|
gtk_snapshot_push_rounded_clip (snapshot, &content_box);
|
||||||
&content_box,
|
|
||||||
"ColorSwatchClip");
|
|
||||||
|
|
||||||
if (swatch->priv->use_alpha && !gdk_rgba_is_opaque (&swatch->priv->color))
|
if (swatch->priv->use_alpha && !gdk_rgba_is_opaque (&swatch->priv->color))
|
||||||
{
|
{
|
||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot, &content_box.bounds);
|
||||||
&content_box.bounds,
|
|
||||||
"CheckeredBackground");
|
|
||||||
cairo_set_source_rgb (cr, 0.33, 0.33, 0.33);
|
cairo_set_source_rgb (cr, 0.33, 0.33, 0.33);
|
||||||
cairo_paint (cr);
|
cairo_paint (cr);
|
||||||
|
|
||||||
@ -143,8 +139,7 @@ swatch_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&swatch->priv->color,
|
&swatch->priv->color,
|
||||||
&content_box.bounds,
|
&content_box.bounds);
|
||||||
"ColorSwatch Color");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -154,8 +149,7 @@ swatch_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&color,
|
&color,
|
||||||
&content_box.bounds,
|
&content_box.bounds);
|
||||||
"ColorSwatch Opaque Color");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
@ -172,11 +166,10 @@ drag_set_color_icon (GdkDragContext *context,
|
|||||||
GtkSnapshot *snapshot;
|
GtkSnapshot *snapshot;
|
||||||
GdkPaintable *paintable;
|
GdkPaintable *paintable;
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "ColorDragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
color,
|
color,
|
||||||
&GRAPHENE_RECT_INIT(0, 0, 48, 32),
|
&GRAPHENE_RECT_INIT(0, 0, 48, 32));
|
||||||
"ColorDragColor");
|
|
||||||
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
||||||
|
|
||||||
gtk_drag_set_icon_paintable (context, paintable, 4, 4);
|
gtk_drag_set_icon_paintable (context, paintable, 4, 4);
|
||||||
|
@ -875,15 +875,14 @@ gtk_css_filter_value_push_snapshot (const GtkCssValue *filter,
|
|||||||
if (i < j)
|
if (i < j)
|
||||||
gtk_snapshot_push_color_matrix (snapshot,
|
gtk_snapshot_push_color_matrix (snapshot,
|
||||||
&matrix,
|
&matrix,
|
||||||
&offset,
|
&offset);
|
||||||
"CssFilter ColorMatrix<%d-%d>", i, j);
|
|
||||||
|
|
||||||
if (j < filter->n_filters)
|
if (j < filter->n_filters)
|
||||||
{
|
{
|
||||||
if (filter->filters[j].type == GTK_CSS_FILTER_BLUR)
|
if (filter->filters[j].type == GTK_CSS_FILTER_BLUR)
|
||||||
{
|
{
|
||||||
radius = _gtk_css_number_value_get (filter->filters[j].blur.value, 100.0);
|
radius = _gtk_css_number_value_get (filter->filters[j].blur.value, 100.0);
|
||||||
gtk_snapshot_push_blur (snapshot, radius, "CssFilter Blur<%d, radius %g>", j, radius);
|
gtk_snapshot_push_blur (snapshot, radius);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
g_warning ("Don't know how to handle filter type %d", filter->filters[j].type);
|
g_warning ("Don't know how to handle filter type %d", filter->filters[j].type);
|
||||||
|
@ -251,7 +251,7 @@ _gtk_css_image_draw (GtkCssImage *image,
|
|||||||
|
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "Fallback<%s>", G_OBJECT_TYPE_NAME (image));
|
snapshot = gtk_snapshot_new ();
|
||||||
gtk_css_image_snapshot (image, snapshot, width, height);
|
gtk_css_image_snapshot (image, snapshot, width, height);
|
||||||
node = gtk_snapshot_free_to_node (snapshot);
|
node = gtk_snapshot_free_to_node (snapshot);
|
||||||
|
|
||||||
|
@ -663,8 +663,7 @@ gtk_css_image_builtin_snapshot (GtkCssImage *image,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"BuiltinImage<%d>", (int) image_type);
|
|
||||||
gtk_css_image_builtin_draw (image, cr, width, height, image_type);
|
gtk_css_image_builtin_draw (image, cr, width, height, image_type);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
}
|
}
|
||||||
|
@ -141,7 +141,7 @@ gtk_css_image_cross_fade_snapshot (GtkCssImage *image,
|
|||||||
{
|
{
|
||||||
GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
|
GtkCssImageCrossFade *cross_fade = GTK_CSS_IMAGE_CROSS_FADE (image);
|
||||||
|
|
||||||
gtk_snapshot_push_cross_fade (snapshot, cross_fade->progress, "CrossFadeImage<%g>", cross_fade->progress);
|
gtk_snapshot_push_cross_fade (snapshot, cross_fade->progress);
|
||||||
|
|
||||||
if (cross_fade->start)
|
if (cross_fade->start)
|
||||||
gtk_css_image_snapshot (cross_fade->start, snapshot, width, height);
|
gtk_css_image_snapshot (cross_fade->start, snapshot, width, height);
|
||||||
|
@ -78,7 +78,7 @@ gtk_css_image_fallback_snapshot (GtkCssImage *image,
|
|||||||
else
|
else
|
||||||
color = &red;
|
color = &red;
|
||||||
|
|
||||||
gtk_snapshot_append_color (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));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
gtk_css_image_snapshot (fallback->images[fallback->used], snapshot, width, height);
|
gtk_css_image_snapshot (fallback->images[fallback->used], snapshot, width, height);
|
||||||
|
@ -111,7 +111,7 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
|
|||||||
});
|
});
|
||||||
graphene_vec4_init (&offset, fg.red, fg.green, fg.blue, 0);
|
graphene_vec4_init (&offset, fg.red, fg.green, fg.blue, 0);
|
||||||
|
|
||||||
gtk_snapshot_push_color_matrix (snapshot, &matrix, &offset, "Recolor");
|
gtk_snapshot_push_color_matrix (snapshot, &matrix, &offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot,
|
gtk_snapshot_append_texture (snapshot,
|
||||||
@ -121,8 +121,7 @@ gtk_css_image_icon_theme_snapshot (GtkCssImage *image,
|
|||||||
(height - texture_height) / 2.0,
|
(height - texture_height) / 2.0,
|
||||||
texture_width,
|
texture_width,
|
||||||
texture_height
|
texture_height
|
||||||
),
|
));
|
||||||
"CssImageIconTheme<%s@%d>", icon_theme->name, icon_theme->scale);
|
|
||||||
if (symbolic)
|
if (symbolic)
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
@ -186,8 +186,7 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
_gtk_css_rgba_value_get_rgba (stop->color),
|
_gtk_css_rgba_value_get_rgba (stop->color),
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"RepeatingLinearGradient<degenerate>");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +237,7 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
|
|||||||
&GRAPHENE_POINT_INIT (width / 2 + x * (start - 0.5), height / 2 + y * (start - 0.5)),
|
&GRAPHENE_POINT_INIT (width / 2 + x * (start - 0.5), height / 2 + y * (start - 0.5)),
|
||||||
&GRAPHENE_POINT_INIT (width / 2 + x * (end - 0.5), height / 2 + y * (end - 0.5)),
|
&GRAPHENE_POINT_INIT (width / 2 + x * (end - 0.5), height / 2 + y * (end - 0.5)),
|
||||||
stops,
|
stops,
|
||||||
linear->stops->len,
|
linear->stops->len);
|
||||||
"RepeatingLinearGradient<%ustops>", linear->stops->len);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -249,8 +247,7 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
|
|||||||
&GRAPHENE_POINT_INIT (width / 2 + x * (start - 0.5), height / 2 + y * (start - 0.5)),
|
&GRAPHENE_POINT_INIT (width / 2 + x * (start - 0.5), height / 2 + y * (start - 0.5)),
|
||||||
&GRAPHENE_POINT_INIT (width / 2 + x * (end - 0.5), height / 2 + y * (end - 0.5)),
|
&GRAPHENE_POINT_INIT (width / 2 + x * (end - 0.5), height / 2 + y * (end - 0.5)),
|
||||||
stops,
|
stops,
|
||||||
linear->stops->len,
|
linear->stops->len);
|
||||||
"LinearGradient<%ustops>", linear->stops->len);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,8 +91,7 @@ gtk_css_image_radial_snapshot (GtkCssImage *image,
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"Fallback<%s>", G_OBJECT_TYPE_NAME (image));
|
|
||||||
|
|
||||||
x = _gtk_css_position_value_get_x (radial->position, width);
|
x = _gtk_css_position_value_get_x (radial->position, width);
|
||||||
y = _gtk_css_position_value_get_y (radial->position, height);
|
y = _gtk_css_position_value_get_y (radial->position, height);
|
||||||
|
@ -192,14 +192,11 @@ gtk_css_image_recolor_snapshot (GtkCssImage *image,
|
|||||||
0, 0, 0, fg.alpha
|
0, 0, 0, fg.alpha
|
||||||
});
|
});
|
||||||
graphene_vec4_init (&offset, fg.red, fg.green, fg.blue, 0);
|
graphene_vec4_init (&offset, fg.red, fg.green, fg.blue, 0);
|
||||||
gtk_snapshot_push_color_matrix (snapshot, &matrix, &offset, "Recolor");
|
gtk_snapshot_push_color_matrix (snapshot, &matrix, &offset);
|
||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot,
|
gtk_snapshot_append_texture (snapshot,
|
||||||
recolor->texture,
|
recolor->texture,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"Recolor Image %dx%d",
|
|
||||||
gdk_texture_get_width (recolor->texture),
|
|
||||||
gdk_texture_get_height (recolor->texture));
|
|
||||||
|
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,7 @@ gtk_css_image_win32_snapshot (GtkCssImage *image,
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"Fallback<%s>", G_OBJECT_TYPE_NAME (image));
|
|
||||||
|
|
||||||
surface = gtk_win32_theme_create_surface (wimage->theme, wimage->part, wimage->state, wimage->margins,
|
surface = gtk_win32_theme_create_surface (wimage->theme, wimage->part, wimage->state, wimage->margins,
|
||||||
width, height, &dx, &dy);
|
width, height, &dx, &dy);
|
||||||
|
@ -417,7 +417,7 @@ gtk_css_shadows_value_push_snapshot (const GtkCssValue *value,
|
|||||||
{
|
{
|
||||||
GskShadow *shadows = g_newa (GskShadow, value->len);
|
GskShadow *shadows = g_newa (GskShadow, value->len);
|
||||||
gtk_css_shadows_value_get_shadows (value, shadows);
|
gtk_css_shadows_value_get_shadows (value, shadows);
|
||||||
gtk_snapshot_push_shadow (snapshot, shadows, value->len, "Shadow<%u>", value->len);
|
gtk_snapshot_push_shadow (snapshot, shadows, value->len);
|
||||||
}
|
}
|
||||||
|
|
||||||
return need_shadow;
|
return need_shadow;
|
||||||
|
@ -1055,8 +1055,6 @@ gtk_css_shadow_value_snapshot_outset (const GtkCssValue *shadow,
|
|||||||
_gtk_css_number_value_get (shadow->voffset, 0),
|
_gtk_css_number_value_get (shadow->voffset, 0),
|
||||||
_gtk_css_number_value_get (shadow->spread, 0),
|
_gtk_css_number_value_get (shadow->spread, 0),
|
||||||
_gtk_css_number_value_get (shadow->radius, 0));
|
_gtk_css_number_value_get (shadow->radius, 0));
|
||||||
if (gtk_snapshot_get_record_names (snapshot))
|
|
||||||
gsk_render_node_set_name (node, "Outset Shadow");
|
|
||||||
gtk_snapshot_append_node_internal (snapshot, node);
|
gtk_snapshot_append_node_internal (snapshot, node);
|
||||||
gsk_render_node_unref (node);
|
gsk_render_node_unref (node);
|
||||||
}
|
}
|
||||||
@ -1086,8 +1084,6 @@ gtk_css_shadow_value_snapshot_inset (const GtkCssValue *shadow,
|
|||||||
_gtk_css_number_value_get (shadow->voffset, 0),
|
_gtk_css_number_value_get (shadow->voffset, 0),
|
||||||
_gtk_css_number_value_get (shadow->spread, 0),
|
_gtk_css_number_value_get (shadow->spread, 0),
|
||||||
_gtk_css_number_value_get (shadow->radius, 0));
|
_gtk_css_number_value_get (shadow->radius, 0));
|
||||||
if (gtk_snapshot_get_record_names (snapshot))
|
|
||||||
gsk_render_node_set_name (node, "Inset Shadow");
|
|
||||||
gtk_snapshot_append_node_internal (snapshot, node);
|
gtk_snapshot_append_node_internal (snapshot, node);
|
||||||
gsk_render_node_unref (node);
|
gsk_render_node_unref (node);
|
||||||
}
|
}
|
||||||
|
@ -250,8 +250,7 @@ gtk_drawing_area_snapshot (GtkWidget *widget,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
0, 0,
|
0, 0,
|
||||||
width, height
|
width, height
|
||||||
),
|
));
|
||||||
"DrawingAreaContents");
|
|
||||||
priv->draw_func (self,
|
priv->draw_func (self,
|
||||||
cr,
|
cr,
|
||||||
width, height,
|
width, height,
|
||||||
|
@ -3321,8 +3321,7 @@ gtk_entry_snapshot (GtkWidget *widget,
|
|||||||
priv->text_x,
|
priv->text_x,
|
||||||
0,
|
0,
|
||||||
priv->text_width,
|
priv->text_width,
|
||||||
gtk_widget_get_height (widget)),
|
gtk_widget_get_height (widget)));
|
||||||
"Entry Clip");
|
|
||||||
|
|
||||||
/* Draw text and cursor */
|
/* Draw text and cursor */
|
||||||
if (priv->dnd_position != -1)
|
if (priv->dnd_position != -1)
|
||||||
@ -5700,7 +5699,7 @@ gtk_entry_draw_text (GtkEntry *entry,
|
|||||||
clip = gdk_pango_layout_get_clip_region (layout, x, y, range, 1);
|
clip = gdk_pango_layout_get_clip_region (layout, x, y, range, 1);
|
||||||
cairo_region_get_extents (clip, &clip_extents);
|
cairo_region_get_extents (clip, &clip_extents);
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_extents), "Selected Text");
|
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_extents));
|
||||||
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
|
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
|
||||||
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
@ -5763,7 +5762,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
|
|||||||
|
|
||||||
gtk_style_context_save_to_node (context, priv->block_cursor_node);
|
gtk_style_context_save_to_node (context, priv->block_cursor_node);
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &bounds, "Block Cursor");
|
gtk_snapshot_push_clip (snapshot, &bounds);
|
||||||
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
|
gtk_snapshot_render_background (snapshot, context, 0, 0, width, height);
|
||||||
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
gtk_snapshot_render_layout (snapshot, context, x, y, layout);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
@ -2348,8 +2348,7 @@ gtk_flow_box_snapshot (GtkWidget *widget,
|
|||||||
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
|
vertical = priv->orientation == GTK_ORIENTATION_VERTICAL;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (x, y, width, height),
|
&GRAPHENE_RECT_INIT (x, y, width, height));
|
||||||
"FlowBox Rubberband");
|
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
gtk_style_context_save_to_node (context, priv->rubberband_node);
|
gtk_style_context_save_to_node (context, priv->rubberband_node);
|
||||||
|
@ -744,8 +744,7 @@ gtk_gl_area_snapshot (GtkWidget *widget,
|
|||||||
texture->holder,
|
texture->holder,
|
||||||
&GRAPHENE_RECT_INIT (0, 0,
|
&GRAPHENE_RECT_INIT (0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)),
|
gtk_widget_get_height (widget)));
|
||||||
"GL Area");
|
|
||||||
|
|
||||||
g_object_unref (texture->holder);
|
g_object_unref (texture->holder);
|
||||||
}
|
}
|
||||||
|
@ -1665,8 +1665,7 @@ gtk_icon_view_snapshot (GtkWidget *widget,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
0, 0,
|
0, 0,
|
||||||
width, height
|
width, height
|
||||||
),
|
));
|
||||||
"IconView Clip");
|
|
||||||
|
|
||||||
gtk_snapshot_offset (snapshot,
|
gtk_snapshot_offset (snapshot,
|
||||||
- gtk_adjustment_get_value (icon_view->priv->hadjustment),
|
- gtk_adjustment_get_value (icon_view->priv->hadjustment),
|
||||||
@ -6699,7 +6698,7 @@ gtk_icon_view_create_drag_icon (GtkIconView *icon_view,
|
|||||||
|
|
||||||
if (index == item->index)
|
if (index == item->index)
|
||||||
{
|
{
|
||||||
snapshot = gtk_snapshot_new (FALSE, "IconView DragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
gtk_icon_view_snapshot_item (icon_view, snapshot, item,
|
gtk_icon_view_snapshot_item (icon_view, snapshot, item,
|
||||||
icon_view->priv->item_padding,
|
icon_view->priv->item_padding,
|
||||||
icon_view->priv->item_padding,
|
icon_view->priv->item_padding,
|
||||||
|
@ -3870,7 +3870,7 @@ gtk_label_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
cairo_region_get_rectangle (range_clip, i, &clip_rect);
|
cairo_region_get_rectangle (range_clip, i, &clip_rect);
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect), "Selected Text");
|
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect));
|
||||||
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
|
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
|
||||||
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
@ -3918,7 +3918,7 @@ gtk_label_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
cairo_region_get_rectangle (range_clip, i, &clip_rect);
|
cairo_region_get_rectangle (range_clip, i, &clip_rect);
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect), "Active Link");
|
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_FROM_RECT (&clip_rect));
|
||||||
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
|
gtk_snapshot_render_background (snapshot, context, x, 0, width, height);
|
||||||
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
gtk_snapshot_render_layout (snapshot, context, lx, ly, priv->layout);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
@ -117,8 +117,7 @@ gtk_magnifier_snapshot (GtkWidget *widget,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, width, height),
|
&GRAPHENE_RECT_INIT (0, 0, width, height));
|
||||||
"MagnifierClip");
|
|
||||||
|
|
||||||
graphene_matrix_init_translate (&transform, &GRAPHENE_POINT3D_INIT (
|
graphene_matrix_init_translate (&transform, &GRAPHENE_POINT3D_INIT (
|
||||||
- CLAMP (priv->x, 0, paintable_width),
|
- CLAMP (priv->x, 0, paintable_width),
|
||||||
@ -130,7 +129,7 @@ gtk_magnifier_snapshot (GtkWidget *widget,
|
|||||||
if (!priv->resize)
|
if (!priv->resize)
|
||||||
graphene_matrix_translate (&transform, &GRAPHENE_POINT3D_INIT (width / 2, height / 2, 0));
|
graphene_matrix_translate (&transform, &GRAPHENE_POINT3D_INIT (width / 2, height / 2, 0));
|
||||||
|
|
||||||
gtk_snapshot_push_transform (snapshot, &transform, "Magnifier transform");
|
gtk_snapshot_push_transform (snapshot, &transform);
|
||||||
gdk_paintable_snapshot (priv->paintable, snapshot, paintable_width, paintable_height);
|
gdk_paintable_snapshot (priv->paintable, snapshot, paintable_width, paintable_height);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
|
||||||
|
@ -2743,8 +2743,7 @@ gtk_menu_snapshot (GtkWidget *widget,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)),
|
gtk_widget_get_height (widget)));
|
||||||
"MenuClip");
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_menu_parent_class)->snapshot (widget, snapshot);
|
GTK_WIDGET_CLASS (gtk_menu_parent_class)->snapshot (widget, snapshot);
|
||||||
|
|
||||||
|
@ -672,8 +672,7 @@ gtk_overlay_snapshot (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkSnapshot *child_snapshot;
|
GtkSnapshot *child_snapshot;
|
||||||
|
|
||||||
child_snapshot = gtk_snapshot_new (gtk_snapshot_get_record_names (snapshot),
|
child_snapshot = gtk_snapshot_new ();
|
||||||
"OverlayCaptureMainChild");
|
|
||||||
gtk_snapshot_offset (child_snapshot, main_alloc.x, main_alloc.y);
|
gtk_snapshot_offset (child_snapshot, main_alloc.x, main_alloc.y);
|
||||||
gtk_widget_snapshot (main_widget, child_snapshot);
|
gtk_widget_snapshot (main_widget, child_snapshot);
|
||||||
gtk_snapshot_offset (child_snapshot, -main_alloc.x, -main_alloc.y);
|
gtk_snapshot_offset (child_snapshot, -main_alloc.x, -main_alloc.y);
|
||||||
@ -682,8 +681,8 @@ gtk_overlay_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_widget_get_allocation (child, &alloc);
|
gtk_widget_get_allocation (child, &alloc);
|
||||||
graphene_rect_init (&bounds, alloc.x, alloc.y, alloc.width, alloc.height);
|
graphene_rect_init (&bounds, alloc.x, alloc.y, alloc.width, alloc.height);
|
||||||
gtk_snapshot_push_clip (snapshot, &bounds, "Overlay Effect Clip");
|
gtk_snapshot_push_clip (snapshot, &bounds);
|
||||||
gtk_snapshot_push_blur (snapshot, blur, "Overlay Effect");
|
gtk_snapshot_push_blur (snapshot, blur);
|
||||||
gtk_snapshot_append_node (snapshot, main_widget_node);
|
gtk_snapshot_append_node (snapshot, main_widget_node);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
@ -714,7 +713,7 @@ gtk_overlay_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
cairo_region_get_rectangle (clip, i, &rect);
|
cairo_region_get_rectangle (clip, i, &rect);
|
||||||
graphene_rect_init (&bounds, rect.x, rect.y, rect.width, rect.height);
|
graphene_rect_init (&bounds, rect.x, rect.y, rect.width, rect.height);
|
||||||
gtk_snapshot_push_clip (snapshot, &bounds, "Overlay Non-Effect Clip");
|
gtk_snapshot_push_clip (snapshot, &bounds);
|
||||||
gtk_snapshot_append_node (snapshot, main_widget_node);
|
gtk_snapshot_append_node (snapshot, main_widget_node);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
@ -1404,8 +1404,7 @@ gtk_paned_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)
|
gtk_widget_get_height (widget)
|
||||||
),
|
));
|
||||||
"GtkPaned");
|
|
||||||
|
|
||||||
if (priv->child1 && gtk_widget_get_visible (priv->child1) &&
|
if (priv->child1 && gtk_widget_get_visible (priv->child1) &&
|
||||||
priv->child2 && gtk_widget_get_visible (priv->child2))
|
priv->child2 && gtk_widget_get_visible (priv->child2))
|
||||||
|
@ -1216,8 +1216,7 @@ gtk_popover_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)
|
gtk_widget_get_height (widget)
|
||||||
),
|
));
|
||||||
"Popover");
|
|
||||||
|
|
||||||
/* Clip to the arrow shape */
|
/* Clip to the arrow shape */
|
||||||
cairo_save (cr);
|
cairo_save (cr);
|
||||||
|
@ -90,18 +90,15 @@ gtk_theming_background_snapshot_color (const GtkThemingBackground *bg,
|
|||||||
{
|
{
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
bg_color,
|
bg_color,
|
||||||
&bg->boxes[clip].bounds,
|
&bg->boxes[clip].bounds);
|
||||||
"BackgroundColor");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gtk_snapshot_push_rounded_clip (snapshot,
|
gtk_snapshot_push_rounded_clip (snapshot,
|
||||||
&bg->boxes[clip],
|
&bg->boxes[clip]);
|
||||||
"BackgroundColorClip");
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
bg_color,
|
bg_color,
|
||||||
&bg->boxes[clip].bounds,
|
&bg->boxes[clip].bounds);
|
||||||
"BackgroundColor");
|
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -390,7 +387,8 @@ gtk_theming_background_snapshot_layer (const GtkThemingBackground *bg,
|
|||||||
if (image_height == height)
|
if (image_height == height)
|
||||||
vrepeat = GTK_CSS_REPEAT_STYLE_NO_REPEAT;
|
vrepeat = GTK_CSS_REPEAT_STYLE_NO_REPEAT;
|
||||||
|
|
||||||
gtk_snapshot_push_rounded_clip (snapshot, clip, "BackgroundLayerClip<%u>", idx);
|
gtk_snapshot_push_debug (snapshot, "Layer %u", idx);
|
||||||
|
gtk_snapshot_push_rounded_clip (snapshot, clip);
|
||||||
|
|
||||||
gtk_snapshot_offset (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
|
gtk_snapshot_offset (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
|
||||||
|
|
||||||
@ -501,8 +499,7 @@ gtk_theming_background_snapshot_layer (const GtkThemingBackground *bg,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
position_x, position_y,
|
position_x, position_y,
|
||||||
repeat_width, repeat_height
|
repeat_width, repeat_height
|
||||||
),
|
));
|
||||||
"BackgroundLayerRepeat<%u>", idx);
|
|
||||||
|
|
||||||
gtk_snapshot_offset (snapshot,
|
gtk_snapshot_offset (snapshot,
|
||||||
position_x + 0.5 * (repeat_width - image_width),
|
position_x + 0.5 * (repeat_width - image_width),
|
||||||
@ -515,6 +512,7 @@ gtk_theming_background_snapshot_layer (const GtkThemingBackground *bg,
|
|||||||
gtk_snapshot_offset (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
|
gtk_snapshot_offset (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
|
||||||
|
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -640,6 +638,8 @@ gtk_css_style_snapshot_background (GtkCssStyle *style,
|
|||||||
|
|
||||||
gtk_theming_background_init (&bg, style, width, height);
|
gtk_theming_background_init (&bg, style, width, height);
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "CSS background");
|
||||||
|
|
||||||
gtk_css_shadows_value_snapshot_outset (box_shadow,
|
gtk_css_shadows_value_snapshot_outset (box_shadow,
|
||||||
snapshot,
|
snapshot,
|
||||||
&bg.boxes[GTK_CSS_AREA_BORDER_BOX]);
|
&bg.boxes[GTK_CSS_AREA_BORDER_BOX]);
|
||||||
@ -653,8 +653,7 @@ gtk_css_style_snapshot_background (GtkCssStyle *style,
|
|||||||
blend_mode_values[idx] = _gtk_css_blend_mode_value_get (_gtk_css_array_value_get_nth (blend_modes, idx));
|
blend_mode_values[idx] = _gtk_css_blend_mode_value_get (_gtk_css_array_value_get_nth (blend_modes, idx));
|
||||||
|
|
||||||
if (blend_mode_values[idx] != GSK_BLEND_MODE_DEFAULT)
|
if (blend_mode_values[idx] != GSK_BLEND_MODE_DEFAULT)
|
||||||
gtk_snapshot_push_blend (snapshot, blend_mode_values[idx], "Background<%u>Blend<%u>",
|
gtk_snapshot_push_blend (snapshot, blend_mode_values[idx]);
|
||||||
idx, blend_mode_values[idx]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gdk_rgba_is_clear (bg_color))
|
if (!gdk_rgba_is_clear (bg_color))
|
||||||
@ -677,5 +676,7 @@ gtk_css_style_snapshot_background (GtkCssStyle *style,
|
|||||||
gtk_css_shadows_value_snapshot_inset (box_shadow,
|
gtk_css_shadows_value_snapshot_inset (box_shadow,
|
||||||
snapshot,
|
snapshot,
|
||||||
&bg.boxes[GTK_CSS_AREA_PADDING_BOX]);
|
&bg.boxes[GTK_CSS_AREA_PADDING_BOX]);
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,8 +439,6 @@ snapshot_frame_fill (GtkSnapshot *snapshot,
|
|||||||
gsk_rounded_rect_offset (&offset_outline, off_x, off_y);
|
gsk_rounded_rect_offset (&offset_outline, off_x, off_y);
|
||||||
|
|
||||||
node = gsk_border_node_new (&offset_outline, border_width, colors);
|
node = gsk_border_node_new (&offset_outline, border_width, colors);
|
||||||
if (gtk_snapshot_get_record_names (snapshot))
|
|
||||||
gsk_render_node_set_name (node, "Border");
|
|
||||||
gtk_snapshot_append_node_internal (snapshot, node);
|
gtk_snapshot_append_node_internal (snapshot, node);
|
||||||
gsk_render_node_unref (node);
|
gsk_render_node_unref (node);
|
||||||
}
|
}
|
||||||
@ -591,8 +589,7 @@ snapshot_frame_stroke (GtkSnapshot *snapshot,
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&outline->bounds,
|
&outline->bounds);
|
||||||
"BorderStroke");
|
|
||||||
render_frame_stroke (cr, outline, double_width, colors, hidden_side, stroke_style);
|
render_frame_stroke (cr, outline, double_width, colors, hidden_side, stroke_style);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
}
|
}
|
||||||
@ -942,11 +939,12 @@ gtk_css_style_snapshot_border (GtkCssStyle *style,
|
|||||||
{
|
{
|
||||||
double double_width[4] = { border_width[0], border_width[1], border_width[2], border_width[3] };
|
double double_width[4] = { border_width[0], border_width[1], border_width[2], border_width[3] };
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "CSS border image");
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&bounds,
|
&bounds);
|
||||||
"Border Image");
|
|
||||||
gtk_border_image_render (&border_image, double_width, cr, 0, 0, width, height);
|
gtk_border_image_render (&border_image, double_width, cr, 0, 0, width, height);
|
||||||
cairo_destroy (cr);
|
cairo_destroy (cr);
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -978,7 +976,9 @@ gtk_css_style_snapshot_border (GtkCssStyle *style,
|
|||||||
|
|
||||||
gtk_rounded_boxes_init_for_style (&border_box, NULL, NULL, style, 0, 0, width, height);
|
gtk_rounded_boxes_init_for_style (&border_box, NULL, NULL, style, 0, 0, width, height);
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "CSS border");
|
||||||
snapshot_border (snapshot, &border_box, border_width, colors, border_style);
|
snapshot_border (snapshot, &border_box, border_width, colors, border_style);
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,6 +119,8 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style,
|
|||||||
if (!gtk_css_transform_value_get_matrix (transform_value, &transform_matrix))
|
if (!gtk_css_transform_value_get_matrix (transform_value, &transform_matrix))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "CSS Icon @ %gx%g", width, height);
|
||||||
|
|
||||||
gtk_css_filter_value_push_snapshot (filter_value, snapshot);
|
gtk_css_filter_value_push_snapshot (filter_value, snapshot);
|
||||||
|
|
||||||
has_shadow = gtk_css_shadows_value_push_snapshot (shadows_value, snapshot);
|
has_shadow = gtk_css_shadows_value_push_snapshot (shadows_value, snapshot);
|
||||||
@ -137,7 +139,7 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style,
|
|||||||
graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
|
graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
|
||||||
graphene_matrix_multiply (&m2, &m3, &m1);
|
graphene_matrix_multiply (&m2, &m3, &m1);
|
||||||
|
|
||||||
gtk_snapshot_push_transform (snapshot, &m1, "CSS Icon Transform Container");
|
gtk_snapshot_push_transform (snapshot, &m1);
|
||||||
|
|
||||||
gtk_css_image_builtin_snapshot (image, snapshot, width, height, builtin_type);
|
gtk_css_image_builtin_snapshot (image, snapshot, width, height, builtin_type);
|
||||||
|
|
||||||
@ -148,6 +150,8 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style,
|
|||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
|
|
||||||
gtk_css_filter_value_pop_snapshot (filter_value, snapshot);
|
gtk_css_filter_value_pop_snapshot (filter_value, snapshot);
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -309,7 +313,7 @@ gtk_css_style_snapshot_icon_paintable (GtkCssStyle *style,
|
|||||||
});
|
});
|
||||||
graphene_vec4_init (&color_offset, fg.red, fg.green, fg.blue, 0);
|
graphene_vec4_init (&color_offset, fg.red, fg.green, fg.blue, 0);
|
||||||
|
|
||||||
gtk_snapshot_push_color_matrix (snapshot, &color_matrix, &color_offset, "Recoloring Icon");
|
gtk_snapshot_push_color_matrix (snapshot, &color_matrix, &color_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (graphene_matrix_is_identity (&transform_matrix))
|
if (graphene_matrix_is_identity (&transform_matrix))
|
||||||
@ -326,7 +330,7 @@ gtk_css_style_snapshot_icon_paintable (GtkCssStyle *style,
|
|||||||
graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
|
graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0));
|
||||||
graphene_matrix_multiply (&m2, &m3, &m1);
|
graphene_matrix_multiply (&m2, &m3, &m1);
|
||||||
|
|
||||||
gtk_snapshot_push_transform (snapshot, &m1, "Icon Transform");
|
gtk_snapshot_push_transform (snapshot, &m1);
|
||||||
|
|
||||||
gdk_paintable_snapshot (paintable, snapshot, width, height);
|
gdk_paintable_snapshot (paintable, snapshot, width, height);
|
||||||
|
|
||||||
|
@ -57,11 +57,10 @@ gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
height / (self->bounds.size.height),
|
height / (self->bounds.size.height),
|
||||||
1.0);
|
1.0);
|
||||||
gtk_snapshot_push_transform (snapshot,
|
gtk_snapshot_push_transform (snapshot,
|
||||||
&transform,
|
&transform);
|
||||||
"RenderNodeScaleToFit");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &self->bounds, "RenderNodePaintableClip");
|
gtk_snapshot_push_clip (snapshot, &self->bounds);
|
||||||
gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
|
gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
|
||||||
|
|
||||||
gtk_snapshot_append_node (snapshot, self->node);
|
gtk_snapshot_append_node (snapshot, self->node);
|
||||||
|
@ -637,8 +637,7 @@ gtk_revealer_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)
|
gtk_widget_get_height (widget)
|
||||||
),
|
));
|
||||||
"RevealerClip");
|
|
||||||
gtk_widget_snapshot_child (widget, child, snapshot);
|
gtk_widget_snapshot_child (widget, child, snapshot);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,7 @@ gtk_scaler_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
graphene_matrix_t scale_matrix;
|
graphene_matrix_t scale_matrix;
|
||||||
|
|
||||||
graphene_matrix_init_scale (&scale_matrix, 1.0 / self->scale_factor, 1.0 / self->scale_factor, 1.0);
|
graphene_matrix_init_scale (&scale_matrix, 1.0 / self->scale_factor, 1.0 / self->scale_factor, 1.0);
|
||||||
gtk_snapshot_push_transform (snapshot,
|
gtk_snapshot_push_transform (snapshot, &scale_matrix);
|
||||||
&scale_matrix,
|
|
||||||
"GtkScaler<%g>",
|
|
||||||
self->scale_factor);
|
|
||||||
gdk_paintable_snapshot (self->paintable,
|
gdk_paintable_snapshot (self->paintable,
|
||||||
snapshot,
|
snapshot,
|
||||||
width * self->scale_factor,
|
width * self->scale_factor,
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -52,9 +52,7 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
GType gtk_snapshot_get_type (void) G_GNUC_CONST;
|
GType gtk_snapshot_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GtkSnapshot * gtk_snapshot_new (gboolean record_names,
|
GtkSnapshot * gtk_snapshot_new (void);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (2, 3);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot *snapshot);
|
GskRenderNode * gtk_snapshot_free_to_node (GtkSnapshot *snapshot);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
@ -68,66 +66,42 @@ GdkPaintable * gtk_snapshot_to_paintable (GtkSnapshot
|
|||||||
const graphene_size_t *size);
|
const graphene_size_t *size);
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
gboolean gtk_snapshot_get_record_names (GtkSnapshot *snapshot);
|
void gtk_snapshot_push_debug (GtkSnapshot *snapshot,
|
||||||
|
const char *message,
|
||||||
GDK_AVAILABLE_IN_ALL
|
...) G_GNUC_PRINTF (2, 3);
|
||||||
void gtk_snapshot_push (GtkSnapshot *snapshot,
|
|
||||||
gboolean keep_coordinates,
|
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_transform (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_transform (GtkSnapshot *snapshot,
|
||||||
const graphene_matrix_t*transform,
|
const graphene_matrix_t*transform);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_opacity (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_opacity (GtkSnapshot *snapshot,
|
||||||
double opacity,
|
double opacity);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_blur (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_blur (GtkSnapshot *snapshot,
|
||||||
double radius,
|
double radius);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_color_matrix (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_color_matrix (GtkSnapshot *snapshot,
|
||||||
const graphene_matrix_t*color_matrix,
|
const graphene_matrix_t*color_matrix,
|
||||||
const graphene_vec4_t *color_offset,
|
const graphene_vec4_t *color_offset);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_repeat (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_repeat (GtkSnapshot *snapshot,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds,
|
||||||
const graphene_rect_t *child_bounds,
|
const graphene_rect_t *child_bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_clip (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_clip (GtkSnapshot *snapshot,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_rounded_clip (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_rounded_clip (GtkSnapshot *snapshot,
|
||||||
const GskRoundedRect *bounds,
|
const GskRoundedRect *bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_shadow (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_shadow (GtkSnapshot *snapshot,
|
||||||
const GskShadow *shadow,
|
const GskShadow *shadow,
|
||||||
gsize n_shadows,
|
gsize n_shadows);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_blend (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_blend (GtkSnapshot *snapshot,
|
||||||
GskBlendMode blend_mode,
|
GskBlendMode blend_mode);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
|
void gtk_snapshot_push_cross_fade (GtkSnapshot *snapshot,
|
||||||
double progress,
|
double progress);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_pop (GtkSnapshot *snapshot);
|
void gtk_snapshot_pop (GtkSnapshot *snapshot);
|
||||||
|
|
||||||
@ -145,28 +119,34 @@ void gtk_snapshot_append_node (GtkSnapshot
|
|||||||
GskRenderNode *node);
|
GskRenderNode *node);
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
cairo_t * gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
|
cairo_t * gtk_snapshot_append_cairo (GtkSnapshot *snapshot,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF(3, 4);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_append_texture (GtkSnapshot *snapshot,
|
void gtk_snapshot_append_texture (GtkSnapshot *snapshot,
|
||||||
GdkTexture *texture,
|
GdkTexture *texture,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_append_color (GtkSnapshot *snapshot,
|
void gtk_snapshot_append_color (GtkSnapshot *snapshot,
|
||||||
const GdkRGBA *color,
|
const GdkRGBA *color,
|
||||||
|
const graphene_rect_t *bounds);
|
||||||
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
void gtk_snapshot_append_linear_gradient (GtkSnapshot *snapshot,
|
||||||
const graphene_rect_t *bounds,
|
const graphene_rect_t *bounds,
|
||||||
const char *name,
|
const graphene_point_t *start_point,
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
const graphene_point_t *end_point,
|
||||||
|
const GskColorStop *stops,
|
||||||
|
gsize n_stops);
|
||||||
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
void gtk_snapshot_append_repeating_linear_gradient (GtkSnapshot *snapshot,
|
||||||
|
const graphene_rect_t *bounds,
|
||||||
|
const graphene_point_t *start_point,
|
||||||
|
const graphene_point_t *end_point,
|
||||||
|
const GskColorStop *stops,
|
||||||
|
gsize n_stops);
|
||||||
/* next function implemented in gskpango.c */
|
/* next function implemented in gskpango.c */
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
void gtk_snapshot_append_layout (GtkSnapshot *snapshot,
|
||||||
PangoLayout *layout,
|
PangoLayout *layout,
|
||||||
const GdkRGBA *color,
|
const GdkRGBA *color);
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
|
||||||
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
@ -204,24 +184,6 @@ void gtk_snapshot_render_insertion_cursor (GtkSnapshot
|
|||||||
PangoLayout *layout,
|
PangoLayout *layout,
|
||||||
int index,
|
int index,
|
||||||
PangoDirection direction);
|
PangoDirection direction);
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_snapshot_append_linear_gradient (GtkSnapshot *snapshot,
|
|
||||||
const graphene_rect_t *bounds,
|
|
||||||
const graphene_point_t *start_point,
|
|
||||||
const graphene_point_t *end_point,
|
|
||||||
const GskColorStop *stops,
|
|
||||||
gsize n_stops,
|
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (7, 8);
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
|
||||||
void gtk_snapshot_append_repeating_linear_gradient (GtkSnapshot *snapshot,
|
|
||||||
const graphene_rect_t *bounds,
|
|
||||||
const graphene_point_t *start_point,
|
|
||||||
const graphene_point_t *end_point,
|
|
||||||
const GskColorStop *stops,
|
|
||||||
gsize n_stops,
|
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (7, 8);
|
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
@ -27,11 +27,9 @@ typedef struct _GtkSnapshotState GtkSnapshotState;
|
|||||||
typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot *snapshot,
|
typedef GskRenderNode * (* GtkSnapshotCollectFunc) (GtkSnapshot *snapshot,
|
||||||
GtkSnapshotState *state,
|
GtkSnapshotState *state,
|
||||||
GskRenderNode **nodes,
|
GskRenderNode **nodes,
|
||||||
guint n_nodes,
|
guint n_nodes);
|
||||||
const char *name);
|
|
||||||
|
|
||||||
struct _GtkSnapshotState {
|
struct _GtkSnapshotState {
|
||||||
char *name;
|
|
||||||
guint start_node_index;
|
guint start_node_index;
|
||||||
guint n_nodes;
|
guint n_nodes;
|
||||||
|
|
||||||
@ -76,6 +74,9 @@ struct _GtkSnapshotState {
|
|||||||
double progress;
|
double progress;
|
||||||
GskRenderNode *start_node;
|
GskRenderNode *start_node;
|
||||||
} cross_fade;
|
} cross_fade;
|
||||||
|
struct {
|
||||||
|
char *message;
|
||||||
|
} debug;
|
||||||
} data;
|
} data;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -96,9 +97,6 @@ struct _GtkSnapshotClass {
|
|||||||
GObjectClass parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
|
GObjectClass parent_class; /* it's really GdkSnapshotClass, but don't tell anyone! */
|
||||||
};
|
};
|
||||||
|
|
||||||
GtkSnapshot * gtk_snapshot_new_child (GtkSnapshot *parent,
|
|
||||||
const char *name,
|
|
||||||
...) G_GNUC_PRINTF (2, 3);
|
|
||||||
void gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
void gtk_snapshot_append_node_internal (GtkSnapshot *snapshot,
|
||||||
GskRenderNode *node);
|
GskRenderNode *node);
|
||||||
|
|
||||||
|
@ -1787,7 +1787,7 @@ gtk_stack_snapshot_crossfade (GtkWidget *widget,
|
|||||||
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
|
GtkStackPrivate *priv = gtk_stack_get_instance_private (stack);
|
||||||
gdouble progress = gtk_progress_tracker_get_progress (&priv->tracker, FALSE);
|
gdouble progress = gtk_progress_tracker_get_progress (&priv->tracker, FALSE);
|
||||||
|
|
||||||
gtk_snapshot_push_cross_fade (snapshot, progress, "CrossFade<%g>", progress);
|
gtk_snapshot_push_cross_fade (snapshot, progress);
|
||||||
|
|
||||||
if (priv->last_visible_node)
|
if (priv->last_visible_node)
|
||||||
{
|
{
|
||||||
@ -1849,9 +1849,7 @@ gtk_stack_snapshot_under (GtkWidget *widget,
|
|||||||
g_assert_not_reached ();
|
g_assert_not_reached ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot, &GRAPHENE_RECT_INIT(x, y, width, height));
|
||||||
&GRAPHENE_RECT_INIT(x, y, width, height),
|
|
||||||
"StackUnder");
|
|
||||||
|
|
||||||
gtk_widget_snapshot_child (widget,
|
gtk_widget_snapshot_child (widget,
|
||||||
priv->visible_child->widget,
|
priv->visible_child->widget,
|
||||||
@ -1946,8 +1944,7 @@ gtk_stack_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_widget_get_allocation (priv->last_visible_child->widget,
|
gtk_widget_get_allocation (priv->last_visible_child->widget,
|
||||||
&priv->last_visible_surface_allocation);
|
&priv->last_visible_surface_allocation);
|
||||||
last_visible_snapshot = gtk_snapshot_new (gtk_snapshot_get_record_names (snapshot),
|
last_visible_snapshot = gtk_snapshot_new ();
|
||||||
"StackCaptureLastVisibleChild");
|
|
||||||
gtk_widget_snapshot (priv->last_visible_child->widget, last_visible_snapshot);
|
gtk_widget_snapshot (priv->last_visible_child->widget, last_visible_snapshot);
|
||||||
priv->last_visible_node = gtk_snapshot_free_to_node (last_visible_snapshot);
|
priv->last_visible_node = gtk_snapshot_free_to_node (last_visible_snapshot);
|
||||||
}
|
}
|
||||||
@ -1957,8 +1954,7 @@ gtk_stack_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)
|
gtk_widget_get_height (widget)
|
||||||
),
|
));
|
||||||
"StackAnimationClip");
|
|
||||||
|
|
||||||
switch (priv->active_transition_type)
|
switch (priv->active_transition_type)
|
||||||
{
|
{
|
||||||
|
@ -1795,9 +1795,7 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
|
||||||
get_insertion_cursor_bounds (height, direction, draw_arrow, &bounds);
|
get_insertion_cursor_bounds (height, direction, draw_arrow, &bounds);
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot, &bounds);
|
||||||
&bounds,
|
|
||||||
"%s Cursor", is_primary ? "Primary" : "Secondary");
|
|
||||||
|
|
||||||
draw_insertion_cursor (context, cr, 0, 0, height, is_primary, direction, draw_arrow);
|
draw_insertion_cursor (context, cr, 0, 0, height, is_primary, direction, draw_arrow);
|
||||||
|
|
||||||
|
@ -226,12 +226,12 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
|
|||||||
|
|
||||||
limit_layout_lines (layout);
|
limit_layout_lines (layout);
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "TextDragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
|
|
||||||
style_context = gtk_widget_get_style_context (widget);
|
style_context = gtk_widget_get_style_context (widget);
|
||||||
gtk_style_context_get_color (style_context,
|
gtk_style_context_get_color (style_context,
|
||||||
&color);
|
&color);
|
||||||
gtk_snapshot_append_layout (snapshot, layout, &color, "TextDragIcon");
|
gtk_snapshot_append_layout (snapshot, layout, &color);
|
||||||
|
|
||||||
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);
|
||||||
g_object_unref (layout);
|
g_object_unref (layout);
|
||||||
@ -332,10 +332,9 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
|
|||||||
layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH);
|
layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH);
|
||||||
layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT);
|
layout_height = MIN (layout_height, DRAG_ICON_MAX_HEIGHT);
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "RichTextDragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (0, 0, layout_width, layout_height),
|
&GRAPHENE_RECT_INIT (0, 0, layout_width, layout_height));
|
||||||
"Text");
|
|
||||||
|
|
||||||
gtk_text_layout_draw (layout, widget, cr);
|
gtk_text_layout_draw (layout, widget, cr);
|
||||||
|
|
||||||
|
@ -5432,9 +5432,9 @@ gtk_text_view_snapshot (GtkWidget *widget,
|
|||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget));
|
gtk_widget_get_height (widget));
|
||||||
|
|
||||||
gtk_snapshot_push_clip (snapshot, &bounds, "Textview Clip");
|
gtk_snapshot_push_clip (snapshot, &bounds);
|
||||||
|
|
||||||
cr = gtk_snapshot_append_cairo (snapshot, &bounds, "GtkTextView");
|
cr = gtk_snapshot_append_cairo (snapshot, &bounds);
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
|
|
||||||
|
@ -4441,8 +4441,7 @@ gtk_tree_view_snapshot_line (GtkTreeView *tree_view,
|
|||||||
MIN (y1, y2),
|
MIN (y1, y2),
|
||||||
ABS (x2 - x1) + 1,
|
ABS (x2 - x1) + 1,
|
||||||
ABS (y2 - y1) + 1
|
ABS (y2 - y1) + 1
|
||||||
),
|
));
|
||||||
"TreeViewGridLine");
|
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
|
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
|
||||||
|
|
||||||
@ -4840,8 +4839,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
|
|||||||
cell_area.y + cell_area.height / 2,
|
cell_area.y + cell_area.height / 2,
|
||||||
cell_area.x + cell_area.width,
|
cell_area.x + cell_area.width,
|
||||||
1
|
1
|
||||||
),
|
));
|
||||||
"Separator");
|
|
||||||
|
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
@ -4881,8 +4879,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
|
|||||||
cell_area.y + cell_area.height / 2,
|
cell_area.y + cell_area.height / 2,
|
||||||
cell_area.x + cell_area.width,
|
cell_area.x + cell_area.width,
|
||||||
1
|
1
|
||||||
),
|
));
|
||||||
"Separator");
|
|
||||||
|
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
@ -5144,8 +5141,7 @@ gtk_tree_view_snapshot (GtkWidget *widget,
|
|||||||
0, gtk_tree_view_get_effective_header_height (tree_view),
|
0, gtk_tree_view_get_effective_header_height (tree_view),
|
||||||
width,
|
width,
|
||||||
height - gtk_tree_view_get_effective_header_height (tree_view)
|
height - gtk_tree_view_get_effective_header_height (tree_view)
|
||||||
),
|
));
|
||||||
"TreeViewContentClip");
|
|
||||||
|
|
||||||
gtk_snapshot_offset (snapshot,
|
gtk_snapshot_offset (snapshot,
|
||||||
- (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
|
- (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
|
||||||
@ -5201,8 +5197,7 @@ gtk_tree_view_snapshot (GtkWidget *widget,
|
|||||||
0, 0,
|
0, 0,
|
||||||
width,
|
width,
|
||||||
gtk_tree_view_get_effective_header_height (tree_view)
|
gtk_tree_view_get_effective_header_height (tree_view)
|
||||||
),
|
));
|
||||||
"TreeViewHeaderClip");
|
|
||||||
|
|
||||||
gtk_style_context_save (context);
|
gtk_style_context_save (context);
|
||||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VIEW);
|
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_VIEW);
|
||||||
@ -13709,7 +13704,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
|
|||||||
|
|
||||||
bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view));
|
bin_window_width = gtk_widget_get_width (GTK_WIDGET (tree_view));
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "TreeView DragIcon");
|
snapshot = gtk_snapshot_new ();
|
||||||
|
|
||||||
gtk_snapshot_render_background (snapshot, context,
|
gtk_snapshot_render_background (snapshot, context,
|
||||||
0, 0,
|
0, 0,
|
||||||
@ -13769,8 +13764,7 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
|
|||||||
cell_area.y + cell_area.height / 2,
|
cell_area.y + cell_area.height / 2,
|
||||||
cell_area.x + cell_area.width,
|
cell_area.x + cell_area.width,
|
||||||
1
|
1
|
||||||
),
|
));
|
||||||
"Separator");
|
|
||||||
|
|
||||||
gtk_style_context_restore (context);
|
gtk_style_context_restore (context);
|
||||||
}
|
}
|
||||||
|
@ -513,8 +513,7 @@ gtk_viewport_snapshot (GtkWidget *widget,
|
|||||||
&GRAPHENE_RECT_INIT(
|
&GRAPHENE_RECT_INIT(
|
||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget),
|
gtk_widget_get_width (widget),
|
||||||
gtk_widget_get_height (widget)),
|
gtk_widget_get_height (widget)));
|
||||||
"Viewport");
|
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_viewport_parent_class)->snapshot (widget, snapshot);
|
GTK_WIDGET_CLASS (gtk_viewport_parent_class)->snapshot (widget, snapshot);
|
||||||
|
|
||||||
|
@ -13037,48 +13037,50 @@ gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
|
|||||||
get_box_border (style, &border);
|
get_box_border (style, &border);
|
||||||
get_box_padding (style, &padding);
|
get_box_padding (style, &padding);
|
||||||
|
|
||||||
|
gtk_snapshot_push_debug (snapshot, "Widget layout debugging");
|
||||||
|
|
||||||
/* Widget margins */
|
/* Widget margins */
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
0, -priv->margin.top,
|
0, -priv->margin.top,
|
||||||
priv->allocation.width, priv->margin.top);
|
priv->allocation.width, priv->margin.top);
|
||||||
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds, "Widget margin top");
|
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
0, priv->allocation.height,
|
0, priv->allocation.height,
|
||||||
priv->allocation.width, priv->margin.bottom);
|
priv->allocation.width, priv->margin.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds, "Widget margin bottom");
|
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
-priv->margin.left, 0,
|
-priv->margin.left, 0,
|
||||||
priv->margin.left, priv->allocation.height);
|
priv->margin.left, priv->allocation.height);
|
||||||
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds, "Widget margin left");
|
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
priv->allocation.width, 0,
|
priv->allocation.width, 0,
|
||||||
priv->margin.right, priv->allocation.height);
|
priv->margin.right, priv->allocation.height);
|
||||||
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds, "Widget margin right");
|
gtk_snapshot_append_color (snapshot, &widget_margin_color, &bounds);
|
||||||
|
|
||||||
|
|
||||||
/* CSS Margins */
|
/* CSS Margins */
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
0, 0,
|
0, 0,
|
||||||
priv->allocation.width, margin.top);
|
priv->allocation.width, margin.top);
|
||||||
gtk_snapshot_append_color (snapshot, &margin_color, &bounds, "Margin top");
|
gtk_snapshot_append_color (snapshot, &margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
0, priv->allocation.height - margin.bottom,
|
0, priv->allocation.height - margin.bottom,
|
||||||
priv->allocation.width, margin.bottom);
|
priv->allocation.width, margin.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &margin_color, &bounds, "Margin bottom");
|
gtk_snapshot_append_color (snapshot, &margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
0, margin.top,
|
0, margin.top,
|
||||||
margin.left, priv->allocation.height - margin.top - margin.bottom);
|
margin.left, priv->allocation.height - margin.top - margin.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &margin_color, &bounds, "Margin left");
|
gtk_snapshot_append_color (snapshot, &margin_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
priv->allocation.width - margin.right, margin.top,
|
priv->allocation.width - margin.right, margin.top,
|
||||||
margin.right, priv->allocation.height - margin.top - margin.bottom);
|
margin.right, priv->allocation.height - margin.top - margin.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &margin_color, &bounds, "Margin right");
|
gtk_snapshot_append_color (snapshot, &margin_color, &bounds);
|
||||||
|
|
||||||
|
|
||||||
/* Padding */
|
/* Padding */
|
||||||
@ -13087,28 +13089,30 @@ gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
|
|||||||
margin.top + border.top,
|
margin.top + border.top,
|
||||||
priv->allocation.width - margin.left - margin.right - border.left - border.right,
|
priv->allocation.width - margin.left - margin.right - border.left - border.right,
|
||||||
padding.top);
|
padding.top);
|
||||||
gtk_snapshot_append_color (snapshot, &padding_color, &bounds, "Padding top");
|
gtk_snapshot_append_color (snapshot, &padding_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
margin.left + border.left,
|
margin.left + border.left,
|
||||||
priv->allocation.height - margin.bottom - border.bottom - padding.bottom,
|
priv->allocation.height - margin.bottom - border.bottom - padding.bottom,
|
||||||
priv->allocation.width - margin.left - margin.right - border.left - border.right,
|
priv->allocation.width - margin.left - margin.right - border.left - border.right,
|
||||||
padding.bottom);
|
padding.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &padding_color, &bounds, "Padding bottom");
|
gtk_snapshot_append_color (snapshot, &padding_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
margin.left + border.left,
|
margin.left + border.left,
|
||||||
margin.top + border.top + padding.top,
|
margin.top + border.top + padding.top,
|
||||||
padding.left,
|
padding.left,
|
||||||
priv->allocation.height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom);
|
priv->allocation.height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &padding_color, &bounds, "Padding left");
|
gtk_snapshot_append_color (snapshot, &padding_color, &bounds);
|
||||||
|
|
||||||
graphene_rect_init (&bounds,
|
graphene_rect_init (&bounds,
|
||||||
priv->allocation.width - margin.right - border.right - padding.right,
|
priv->allocation.width - margin.right - border.right - padding.right,
|
||||||
margin.top + border.top + padding.top,
|
margin.top + border.top + padding.top,
|
||||||
padding.right,
|
padding.right,
|
||||||
priv->allocation.height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom);
|
priv->allocation.height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom);
|
||||||
gtk_snapshot_append_color (snapshot, &padding_color, &bounds, "Padding right");
|
gtk_snapshot_append_color (snapshot, &padding_color, &bounds);
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
|
if (GTK_DISPLAY_DEBUG_CHECK (display, BASELINES))
|
||||||
@ -13133,8 +13137,7 @@ gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
|
|||||||
priv->allocation.width, 1);
|
priv->allocation.width, 1);
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&red,
|
&red,
|
||||||
&bounds,
|
&bounds);
|
||||||
"Baseline Debug");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13150,8 +13153,7 @@ gtk_widget_maybe_add_debug_render_nodes (GtkWidget *widget,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&blue,
|
&blue,
|
||||||
&bounds,
|
&bounds);
|
||||||
"Baseline Debug");
|
|
||||||
priv->highlight_resize = FALSE;
|
priv->highlight_resize = FALSE;
|
||||||
gtk_widget_queue_draw (widget);
|
gtk_widget_queue_draw (widget);
|
||||||
}
|
}
|
||||||
@ -13171,7 +13173,13 @@ gtk_widget_create_render_node (GtkWidget *widget,
|
|||||||
GtkBorder margin, border, padding;
|
GtkBorder margin, border, padding;
|
||||||
GtkSnapshot *snapshot;
|
GtkSnapshot *snapshot;
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new_child (parent_snapshot, "%s<%p>", gtk_widget_get_name (widget), widget);
|
snapshot = gtk_snapshot_new ();
|
||||||
|
|
||||||
|
_gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
gtk_snapshot_push_debug (snapshot,
|
||||||
|
"RenderNode for %s %p @ %d x %d",
|
||||||
|
G_OBJECT_TYPE_NAME (widget), widget,
|
||||||
|
allocation.width, allocation.height);
|
||||||
|
|
||||||
filter_value = _gtk_style_context_peek_property (_gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_FILTER);
|
filter_value = _gtk_style_context_peek_property (_gtk_widget_get_style_context (widget), GTK_CSS_PROPERTY_FILTER);
|
||||||
gtk_css_filter_value_push_snapshot (filter_value, snapshot);
|
gtk_css_filter_value_push_snapshot (filter_value, snapshot);
|
||||||
@ -13182,10 +13190,8 @@ gtk_widget_create_render_node (GtkWidget *widget,
|
|||||||
get_box_padding (style, &padding);
|
get_box_padding (style, &padding);
|
||||||
opacity = priv->alpha / 255.0;
|
opacity = priv->alpha / 255.0;
|
||||||
|
|
||||||
_gtk_widget_get_allocation (widget, &allocation);
|
|
||||||
|
|
||||||
if (opacity < 1.0)
|
if (opacity < 1.0)
|
||||||
gtk_snapshot_push_opacity (snapshot, opacity, "Opacity<%s,%f>", G_OBJECT_TYPE_NAME (widget), opacity);
|
gtk_snapshot_push_opacity (snapshot, opacity);
|
||||||
|
|
||||||
if (!GTK_IS_WINDOW (widget))
|
if (!GTK_IS_WINDOW (widget))
|
||||||
{
|
{
|
||||||
@ -13221,6 +13227,8 @@ gtk_widget_create_render_node (GtkWidget *widget,
|
|||||||
gtk_widget_maybe_add_debug_render_nodes (widget, snapshot);
|
gtk_widget_maybe_add_debug_render_nodes (widget, snapshot);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
|
|
||||||
return gtk_snapshot_free_to_node (snapshot);
|
return gtk_snapshot_free_to_node (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -13261,14 +13269,6 @@ gtk_widget_snapshot (GtkWidget *widget,
|
|||||||
gtk_snapshot_append_node (snapshot, priv->render_node);
|
gtk_snapshot_append_node (snapshot, priv->render_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
should_record_names (GtkWidget *widget,
|
|
||||||
GskRenderer *renderer)
|
|
||||||
{
|
|
||||||
return gtk_inspector_is_recording (widget) ||
|
|
||||||
((gsk_renderer_get_debug_flags (renderer) & GSK_DEBUG_ANY) != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gtk_widget_render (GtkWidget *widget,
|
gtk_widget_render (GtkWidget *widget,
|
||||||
GdkSurface *surface,
|
GdkSurface *surface,
|
||||||
@ -13286,8 +13286,7 @@ gtk_widget_render (GtkWidget *widget,
|
|||||||
if (renderer == NULL)
|
if (renderer == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (should_record_names (widget, renderer),
|
snapshot = gtk_snapshot_new ();
|
||||||
"Render<%s>", G_OBJECT_TYPE_NAME (widget));
|
|
||||||
gtk_widget_snapshot (widget, snapshot);
|
gtk_widget_snapshot (widget, snapshot);
|
||||||
root = gtk_snapshot_free_to_node (snapshot);
|
root = gtk_snapshot_free_to_node (snapshot);
|
||||||
|
|
||||||
|
@ -100,18 +100,12 @@ gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
|
|
||||||
/* need to clip because widgets may draw out of bounds */
|
/* need to clip because widgets may draw out of bounds */
|
||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot,
|
||||||
&GRAPHENE_RECT_INIT(0, 0, width, height),
|
&GRAPHENE_RECT_INIT(0, 0, width, height));
|
||||||
"WidgetPaintableClip<%g,%g>",
|
|
||||||
width, height);
|
|
||||||
graphene_matrix_init_scale (&transform,
|
graphene_matrix_init_scale (&transform,
|
||||||
width / gtk_widget_get_allocated_width (self->widget),
|
width / gtk_widget_get_allocated_width (self->widget),
|
||||||
height / gtk_widget_get_allocated_height (self->widget),
|
height / gtk_widget_get_allocated_height (self->widget),
|
||||||
1.0);
|
1.0);
|
||||||
gtk_snapshot_push_transform (snapshot,
|
gtk_snapshot_push_transform (snapshot, &transform);
|
||||||
&transform,
|
|
||||||
"WidgetPaintableScale<%g,%g>",
|
|
||||||
width / gtk_widget_get_allocated_width (self->widget),
|
|
||||||
height / gtk_widget_get_allocated_height (self->widget));
|
|
||||||
|
|
||||||
gtk_widget_snapshot (self->widget, snapshot);
|
gtk_widget_snapshot (self->widget, snapshot);
|
||||||
|
|
||||||
@ -136,7 +130,7 @@ gtk_widget_paintable_paintable_get_current_image (GdkPaintable *paintable)
|
|||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
return gdk_paintable_new_empty (width, height);
|
return gdk_paintable_new_empty (width, height);
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "WidgetPaintableCurrentImage");
|
snapshot = gtk_snapshot_new ();
|
||||||
gdk_paintable_snapshot (GDK_PAINTABLE (self),
|
gdk_paintable_snapshot (GDK_PAINTABLE (self),
|
||||||
snapshot,
|
snapshot,
|
||||||
width, height);
|
width, height);
|
||||||
|
@ -202,8 +202,7 @@ gtk_cell_renderer_graph_snapshot (GtkCellRenderer *cell,
|
|||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
background_area->x, background_area->y,
|
background_area->x, background_area->y,
|
||||||
background_area->width, background_area->height
|
background_area->width, background_area->height
|
||||||
),
|
));
|
||||||
"CellGraph");
|
|
||||||
|
|
||||||
cairo_set_line_width (cr, 1.0);
|
cairo_set_line_width (cr, 1.0);
|
||||||
|
|
||||||
|
@ -217,15 +217,13 @@ gtk_fps_overlay_snapshot (GtkInspectorOverlay *overlay,
|
|||||||
|
|
||||||
gtk_snapshot_offset (snapshot, bounds.origin.x + bounds.size.width - width, bounds.origin.y);
|
gtk_snapshot_offset (snapshot, bounds.origin.x + bounds.size.width - width, bounds.origin.y);
|
||||||
if (overlay_opacity < 1.0)
|
if (overlay_opacity < 1.0)
|
||||||
gtk_snapshot_push_opacity (snapshot, overlay_opacity, "Fps Overlay Opacity: %g", overlay_opacity);
|
gtk_snapshot_push_opacity (snapshot, overlay_opacity);
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&(GdkRGBA) { 0, 0, 0, 0.5 },
|
&(GdkRGBA) { 0, 0, 0, 0.5 },
|
||||||
&GRAPHENE_RECT_INIT (-1, -1, width + 2, height + 2),
|
&GRAPHENE_RECT_INIT (-1, -1, width + 2, height + 2));
|
||||||
"Fps Overlay background");
|
|
||||||
gtk_snapshot_append_layout (snapshot,
|
gtk_snapshot_append_layout (snapshot,
|
||||||
layout,
|
layout,
|
||||||
&(GdkRGBA) { 1, 1, 1, 1 },
|
&(GdkRGBA) { 1, 1, 1, 1 });
|
||||||
"Fps Overlay: %s", fps_string);
|
|
||||||
if (overlay_opacity < 1.0)
|
if (overlay_opacity < 1.0)
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
gtk_snapshot_offset (snapshot, - bounds.origin.x - bounds.size.width + width, - bounds.origin.y);
|
gtk_snapshot_offset (snapshot, - bounds.origin.x - bounds.size.width + width, - bounds.origin.y);
|
||||||
|
@ -53,8 +53,7 @@ gtk_highlight_overlay_snapshot (GtkInspectorOverlay *overlay,
|
|||||||
|
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&self->color,
|
&self->color,
|
||||||
&bounds,
|
&bounds);
|
||||||
"InspectorHighlight");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -62,7 +62,11 @@ gtk_inspector_overlay_snapshot (GtkInspectorOverlay *self,
|
|||||||
GskRenderNode *node,
|
GskRenderNode *node,
|
||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
|
gtk_snapshot_push_debug (snapshot, "%s %p", G_OBJECT_TYPE_NAME (self), self);
|
||||||
|
|
||||||
GTK_INSPECTOR_OVERLAY_GET_CLASS (self)->snapshot (self, snapshot, node, widget);
|
GTK_INSPECTOR_OVERLAY_GET_CLASS (self)->snapshot (self, snapshot, node, widget);
|
||||||
|
|
||||||
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -226,8 +226,7 @@ gtk_render_node_view_snapshot (GtkWidget *widget,
|
|||||||
|
|
||||||
graphene_rect_init (&rect, 0, 0, width, height);
|
graphene_rect_init (&rect, 0, 0, width, height);
|
||||||
cr = gtk_snapshot_append_cairo (snapshot,
|
cr = gtk_snapshot_append_cairo (snapshot,
|
||||||
&rect,
|
&rect);
|
||||||
"RenderNodeView");
|
|
||||||
|
|
||||||
cairo_translate (cr, width / 2.0, height / 2.0);
|
cairo_translate (cr, width / 2.0, height / 2.0);
|
||||||
if (width < viewport.width || height < viewport.height)
|
if (width < viewport.width || height < viewport.height)
|
||||||
|
@ -227,8 +227,7 @@ gtk_updates_overlay_snapshot (GtkInspectorOverlay *overlay,
|
|||||||
cairo_region_get_rectangle (draw->region, i, &rect);
|
cairo_region_get_rectangle (draw->region, i, &rect);
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&(GdkRGBA) { 1, 0, 0, 0.4 * (1 - progress) },
|
&(GdkRGBA) { 1, 0, 0, 0.4 * (1 - progress) },
|
||||||
&GRAPHENE_RECT_INIT(rect.x, rect.y, rect.width, rect.height),
|
&GRAPHENE_RECT_INIT(rect.x, rect.y, rect.width, rect.height));
|
||||||
"Debug Updates<%g>", progress);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -422,7 +422,7 @@ gtk_inspector_prepare_render (GtkWidget *widget,
|
|||||||
GtkSnapshot *snapshot;
|
GtkSnapshot *snapshot;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
snapshot = gtk_snapshot_new (FALSE, "Inspector Overlay");
|
snapshot = gtk_snapshot_new ();
|
||||||
gtk_snapshot_append_node (snapshot, node);
|
gtk_snapshot_append_node (snapshot, node);
|
||||||
|
|
||||||
for (l = iw->overlays; l; l = l->next)
|
for (l = iw->overlays; l; l = l->next)
|
||||||
|
@ -73,8 +73,7 @@ gtk_node_view_snapshot (GtkWidget *widget,
|
|||||||
gtk_snapshot_push_clip (snapshot,
|
gtk_snapshot_push_clip (snapshot,
|
||||||
&GRAPHENE_RECT_INIT (
|
&GRAPHENE_RECT_INIT (
|
||||||
0, 0,
|
0, 0,
|
||||||
gtk_widget_get_width (widget), gtk_widget_get_height (widget)),
|
gtk_widget_get_width (widget), gtk_widget_get_height (widget)));
|
||||||
"nodeview clip");
|
|
||||||
gtk_snapshot_append_node (snapshot, self->node);
|
gtk_snapshot_append_node (snapshot, self->node);
|
||||||
gtk_snapshot_pop (snapshot);
|
gtk_snapshot_pop (snapshot);
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ snapshot_blur (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkBlurBox *box = (GtkBlurBox *) widget;
|
GtkBlurBox *box = (GtkBlurBox *) widget;
|
||||||
|
|
||||||
gtk_snapshot_push_blur (snapshot, box->radius, "blur");
|
gtk_snapshot_push_blur (snapshot, box->radius);
|
||||||
|
|
||||||
GTK_WIDGET_CLASS (gtk_blur_box_parent_class)->snapshot (widget, snapshot);
|
GTK_WIDGET_CLASS (gtk_blur_box_parent_class)->snapshot (widget, snapshot);
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ gtk_texture_view_snapshot (GtkWidget *widget,
|
|||||||
bounds.size.width = MIN (width, gdk_texture_get_width (self->texture));
|
bounds.size.width = MIN (width, gdk_texture_get_width (self->texture));
|
||||||
bounds.size.height = MIN (height, gdk_texture_get_height (self->texture));
|
bounds.size.height = MIN (height, gdk_texture_get_height (self->texture));
|
||||||
|
|
||||||
gtk_snapshot_append_texture (snapshot, self->texture, &bounds, "Texture");
|
gtk_snapshot_append_texture (snapshot, self->texture, &bounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,8 +174,7 @@ gtk_focus_widget_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
|
|||||||
bounds.size.height = alloc.height;
|
bounds.size.height = alloc.height;
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&black,
|
&black,
|
||||||
&bounds,
|
&bounds);
|
||||||
"Crosshair 1");
|
|
||||||
|
|
||||||
bounds.origin.x = -30;
|
bounds.origin.x = -30;
|
||||||
bounds.origin.y = self->mouse_y;
|
bounds.origin.y = self->mouse_y;
|
||||||
@ -183,8 +182,7 @@ gtk_focus_widget_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
|
|||||||
bounds.size.height = 1;
|
bounds.size.height = 1;
|
||||||
gtk_snapshot_append_color (snapshot,
|
gtk_snapshot_append_color (snapshot,
|
||||||
&black,
|
&black,
|
||||||
&bounds,
|
&bounds);
|
||||||
"Crosshair 2");
|
|
||||||
|
|
||||||
layout = gtk_widget_create_pango_layout (widget, NULL);
|
layout = gtk_widget_create_pango_layout (widget, NULL);
|
||||||
text = g_strdup_printf ("%.2f×%.2f", self->mouse_x, self->mouse_y);
|
text = g_strdup_printf ("%.2f×%.2f", self->mouse_x, self->mouse_y);
|
||||||
|
Loading…
Reference in New Issue
Block a user