From f01208ad9482cf93850ea2a6f159690b6a615446 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 20 Jan 2024 11:02:26 -0500 Subject: [PATCH] gpu: Consistently use ceilf There was a mix of ceil() and ceilf() calls here, but the arguments are always floats, so use ceilf() throughout. --- gsk/gpu/gskgpunodeprocessor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 90a005416c..b736e51d32 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -322,8 +322,8 @@ rect_round_to_pixels (const graphene_rect_t *src, *dest = GRAPHENE_RECT_INIT ( x * inv_xscale - pixel_offset->x, y * inv_yscale - pixel_offset->y, - (ceil ((src->origin.x + pixel_offset->x + src->size.width) * xscale) - x) * inv_xscale, - (ceil ((src->origin.y + pixel_offset->y + src->size.height) * yscale) - y) * inv_yscale); + (ceilf ((src->origin.x + pixel_offset->x + src->size.width) * xscale) - x) * inv_xscale, + (ceilf ((src->origin.y + pixel_offset->y + src->size.height) * yscale) - y) * inv_yscale); } static GskGpuImage * @@ -338,8 +338,8 @@ gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self, area.x = 0; area.y = 0; - area.width = ceil (graphene_vec2_get_x (scale) * viewport->size.width); - area.height = ceil (graphene_vec2_get_y (scale) * viewport->size.height); + area.width = ceilf (graphene_vec2_get_x (scale) * viewport->size.width); + area.height = ceilf (graphene_vec2_get_y (scale) * viewport->size.height); image = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (frame), FALSE, @@ -994,8 +994,8 @@ gsk_gpu_node_processor_blur_op (GskGpuNodeProcessor *self, if (!gsk_rect_intersection (rect, &clip_rect, &intermediate_rect)) return; - width = ceil (graphene_vec2_get_x (&self->scale) * intermediate_rect.size.width); - height = ceil (graphene_vec2_get_y (&self->scale) * intermediate_rect.size.height); + width = ceilf (graphene_vec2_get_x (&self->scale) * intermediate_rect.size.width); + height = ceilf (graphene_vec2_get_y (&self->scale) * intermediate_rect.size.height); intermediate = gsk_gpu_device_create_offscreen_image (gsk_gpu_frame_get_device (self->frame), FALSE, @@ -1814,10 +1814,10 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self, if (shader_clip != GSK_GPU_SHADER_CLIP_NONE) { gsk_rounded_rect_get_largest_cover (&self->clip.rect, &clipped, &cover); - int_clipped.x = ceil (cover.origin.x * scale_x); - int_clipped.y = ceil (cover.origin.y * scale_y); - int_clipped.width = floor ((cover.origin.x + cover.size.width) * scale_x) - int_clipped.x; - int_clipped.height = floor ((cover.origin.y + cover.size.height) * scale_y) - int_clipped.y; + int_clipped.x = ceilf (cover.origin.x * scale_x); + int_clipped.y = ceilf (cover.origin.y * scale_y); + int_clipped.width = floorf ((cover.origin.x + cover.size.width) * scale_x) - int_clipped.x; + int_clipped.height = floorf ((cover.origin.y + cover.size.height) * scale_y) - int_clipped.y; if (int_clipped.width == 0 || int_clipped.height == 0) { gsk_gpu_color_op (self->frame,