summaryrefslogtreecommitdiff
path: root/gtk/gtkcssimagelinear.c
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2017-01-11 16:14:03 +0100
committerAlexander Larsson <alexl@redhat.com>2017-01-11 16:14:03 +0100
commitc00f8dce9f8076e3e914210dda62e7fd2207d1e4 (patch)
tree016ec44ab7b6eea3a595c8f2cdebe3ddb7d1196a /gtk/gtkcssimagelinear.c
parent275185d4157f40def0ec34c98058a98c4b98382f (diff)
downloadgtk+-c00f8dce9f8076e3e914210dda62e7fd2207d1e4.tar.gz
GtkSnapshot: Always use int for the translationwip/alexl/snapshot-int-translate
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.
Diffstat (limited to 'gtk/gtkcssimagelinear.c')
-rw-r--r--gtk/gtkcssimagelinear.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gtk/gtkcssimagelinear.c b/gtk/gtkcssimagelinear.c
index 592180a020..7200c48951 100644
--- a/gtk/gtkcssimagelinear.c
+++ b/gtk/gtkcssimagelinear.c
@@ -136,7 +136,7 @@ gtk_css_image_linear_snapshot (GtkCssImage *image,
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
GskColorStop *stops;
GskRenderNode *node;
- double off_x, off_y; /* snapshot offset */
+ int off_x, off_y; /* snapshot offset */
double angle; /* actual angle of the gradiant line in degrees */
double x, y; /* coordinates of start point */
double length; /* distance in pixels for 100% */