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 | f59f4d774bf32b6c6af165970a2d057ddc72b203 (patch) | |
tree | e0cbb77085164bbc31dee0da37f50eebc6cb1d31 | |
parent | a881cbff3a77eedda6b2bd37cc04636e7130416e (diff) | |
download | gtk+-f59f4d774bf32b6c6af165970a2d057ddc72b203.tar.gz |
scaler: Use new snapshot transforms
-rw-r--r-- | gtk/gtkscaler.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/gtk/gtkscaler.c b/gtk/gtkscaler.c index 266e4dc74a..3824635bf2 100644 --- a/gtk/gtkscaler.c +++ b/gtk/gtkscaler.c @@ -44,22 +44,16 @@ gtk_scaler_paintable_snapshot (GdkPaintable *paintable, { GtkScaler *self = GTK_SCALER (paintable); - if (self->scale_factor == 1.0) - { - gdk_paintable_snapshot (self->paintable, snapshot, width, height); - } - else - { - graphene_matrix_t scale_matrix; - - graphene_matrix_init_scale (&scale_matrix, 1.0 / self->scale_factor, 1.0 / self->scale_factor, 1.0); - gtk_snapshot_push_transform (snapshot, &scale_matrix); - gdk_paintable_snapshot (self->paintable, - snapshot, - width * self->scale_factor, - height * self->scale_factor); - gtk_snapshot_pop (snapshot); - } + gtk_snapshot_save (snapshot); + + gtk_snapshot_scale (snapshot, 1.0 / self->scale_factor, 1.0 / self->scale_factor); + + gdk_paintable_snapshot (self->paintable, + snapshot, + width * self->scale_factor, + height * self->scale_factor); + + gtk_snapshot_restore (snapshot); } static GdkPaintable * |