From c00f8dce9f8076e3e914210dda62e7fd2207d1e4 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 11 Jan 2017 16:14:03 +0100 Subject: GtkSnapshot: Always use int for the translation We already take ints when setting the translation, so it can't currently take any other values. Additionally, I was seeing large costs in int -> double -> int for the rects in gtk_snapshot_clips_rect(), as all callers really are ints (widget allocations) and the clip region is int-based. This change completely cleared a 2% rectangle_init_from_graphene from the profile and is likely to have nice performance effects elsewhere too. --- gtk/gtksnapshotprivate.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gtk/gtksnapshotprivate.h') diff --git a/gtk/gtksnapshotprivate.h b/gtk/gtksnapshotprivate.h index 2384a8b55f..91d1b66ef6 100644 --- a/gtk/gtksnapshotprivate.h +++ b/gtk/gtksnapshotprivate.h @@ -37,8 +37,8 @@ struct _GtkSnapshotState { GPtrArray *nodes; cairo_region_t *clip_region; - double translate_x; - double translate_y; + int translate_x; + int translate_y; GtkSnapshotCollectFunc collect_func; union { -- cgit v1.2.1