diff options
author | Benjamin Otte <otte@redhat.com> | 2019-02-21 05:34:12 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-02-21 19:47:28 +0100 |
commit | 5b10a2929e2b7149a68fbe07635ad01b48189f0d (patch) | |
tree | fccfbc16add764e77da40503a49100fa6ee8bc07 /gtk/gtkrendericon.c | |
parent | b0eceb65d728dd023ec8172d2b7e569b3dadebb3 (diff) | |
download | gtk+-5b10a2929e2b7149a68fbe07635ad01b48189f0d.tar.gz |
rendericon: Use new snapshot transforms
Diffstat (limited to 'gtk/gtkrendericon.c')
-rw-r--r-- | gtk/gtkrendericon.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gtk/gtkrendericon.c b/gtk/gtkrendericon.c index a4d867001f..f79862fa73 100644 --- a/gtk/gtkrendericon.c +++ b/gtk/gtkrendericon.c @@ -73,19 +73,16 @@ gtk_css_style_snapshot_icon (GtkCssStyle *style, } else { - graphene_matrix_t m1, m2, m3; + gtk_snapshot_save (snapshot); /* XXX: Implement -gtk-icon-transform-origin instead of hardcoding "50% 50%" here */ - graphene_matrix_init_translate (&m1, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0)); - graphene_matrix_multiply (&transform_matrix, &m1, &m3); - graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0)); - graphene_matrix_multiply (&m2, &m3, &m1); - - gtk_snapshot_push_transform (snapshot, &m1); + gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (width / 2.0, height / 2.0)); + gtk_snapshot_transform_matrix (snapshot, &transform_matrix); + gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- width / 2.0, - height / 2.0)); gtk_css_image_builtin_snapshot (image, snapshot, width, height, builtin_type); - gtk_snapshot_pop (snapshot); + gtk_snapshot_restore (snapshot); } if (has_shadow) @@ -153,19 +150,16 @@ gtk_css_style_snapshot_icon_paintable (GtkCssStyle *style, } else { - graphene_matrix_t m1, m2, m3; + gtk_snapshot_save (snapshot); /* XXX: Implement -gtk-icon-transform-origin instead of hardcoding "50% 50%" here */ - graphene_matrix_init_translate (&m1, &GRAPHENE_POINT3D_INIT (width / 2.0, height / 2.0, 0)); - graphene_matrix_multiply (&transform_matrix, &m1, &m3); - graphene_matrix_init_translate (&m2, &GRAPHENE_POINT3D_INIT (- width / 2.0, - height / 2.0, 0)); - graphene_matrix_multiply (&m2, &m3, &m1); - - gtk_snapshot_push_transform (snapshot, &m1); + gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (width / 2.0, height / 2.0)); + gtk_snapshot_transform_matrix (snapshot, &transform_matrix); + gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- width / 2.0, - height / 2.0)); gdk_paintable_snapshot (paintable, snapshot, width, height); - gtk_snapshot_pop (snapshot); + gtk_snapshot_restore (snapshot); } if (recolor) |