summaryrefslogtreecommitdiff
path: root/gtk/gtkrendericon.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-07-14 21:24:42 +0200
committerBenjamin Otte <otte@redhat.com>2018-07-24 20:55:45 +0200
commit2a11baf6ea440fe81f90ba45373f9931dad6ce9d (patch)
tree1f9a4c5c97592ad3119f6724e9a535c99d819581 /gtk/gtkrendericon.c
parent51d40ca02372bcf242ed62f84a59d3b9152c4d8d (diff)
downloadgtk+-2a11baf6ea440fe81f90ba45373f9931dad6ce9d.tar.gz
render: Make gtk_render_check/arrow/handle() use the snapshot API
This removes a lot of duplicated code.
Diffstat (limited to 'gtk/gtkrendericon.c')
-rw-r--r--gtk/gtkrendericon.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c
index afed8b613d..5a6be7510f 100644
--- a/gtk/gtkrendericon.c
+++ b/gtk/gtkrendericon.c
@@ -33,64 +33,6 @@
#include <math.h>
void
-gtk_css_style_render_icon (GtkCssStyle *style,
- cairo_t *cr,
- double x,
- double y,
- double width,
- double height,
- GtkCssImageBuiltinType builtin_type)
-{
- const GtkCssValue *shadows;
- graphene_matrix_t graphene_matrix;
- cairo_matrix_t matrix, transform_matrix, saved_matrix;
- GtkCssImage *image;
-
- g_return_if_fail (GTK_IS_CSS_STYLE (style));
- g_return_if_fail (cr != NULL);
-
- image = _gtk_css_image_value_get_image (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SOURCE));
- if (image == NULL)
- return;
-
- cairo_get_matrix (cr, &saved_matrix);
-
- shadows = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_SHADOW);
-
- cairo_translate (cr, x, y);
-
- if (gtk_css_transform_value_get_matrix (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_ICON_TRANSFORM), &graphene_matrix) &&
- graphene_matrix_is_2d (&graphene_matrix))
- {
- graphene_matrix_to_2d (&graphene_matrix,
- &transform_matrix.xx, &transform_matrix.yx,
- &transform_matrix.xy, &transform_matrix.yy,
- &transform_matrix.x0, &transform_matrix.y0);
- /* XXX: Implement -gtk-icon-transform-origin instead of hardcoding "50% 50%" here */
- cairo_matrix_init_translate (&matrix, width / 2, height / 2);
- cairo_matrix_multiply (&matrix, &transform_matrix, &matrix);
- cairo_matrix_translate (&matrix, - width / 2, - height / 2);
-
- if (_gtk_css_shadows_value_is_none (shadows))
- {
- cairo_transform (cr, &matrix);
- gtk_css_image_builtin_draw (image, cr, width, height, builtin_type);
- }
- else
- {
- cairo_push_group (cr);
- cairo_transform (cr, &matrix);
- gtk_css_image_builtin_draw (image, cr, width, height, builtin_type);
- cairo_pop_group_to_source (cr);
- _gtk_css_shadows_value_paint_icon (shadows, cr);
- cairo_paint (cr);
- }
- }
-
- cairo_set_matrix (cr, &saved_matrix);
-}
-
-void
gtk_css_style_snapshot_icon (GtkCssStyle *style,
GtkSnapshot *snapshot,
double width,