diff --git a/mtk/mtk/mtk-rectangle.c b/mtk/mtk/mtk-rectangle.c index 83330b3e0..76cdedca3 100644 --- a/mtk/mtk/mtk-rectangle.c +++ b/mtk/mtk/mtk-rectangle.c @@ -367,4 +367,17 @@ mtk_rectangle_crop_and_scale (const MtkRectangle *rect, graphene_rect_offset (&tmp, src_rect->origin.x, src_rect->origin.y); mtk_rectangle_from_graphene_rect (&tmp, MTK_ROUNDING_STRATEGY_GROW, dest); -} \ No newline at end of file +} + +void +mtk_rectangle_scale_double (const MtkRectangle *rect, + double scale, + MtkRoundingStrategy rounding_strategy, + MtkRectangle *dest) +{ + graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y, + rect->width, rect->height); + + graphene_rect_scale (&tmp, scale, scale, &tmp); + mtk_rectangle_from_graphene_rect (&tmp, rounding_strategy, dest); +} diff --git a/mtk/mtk/mtk-rectangle.h b/mtk/mtk/mtk-rectangle.h index e63a51436..91a8757bf 100644 --- a/mtk/mtk/mtk-rectangle.h +++ b/mtk/mtk/mtk-rectangle.h @@ -130,3 +130,9 @@ void mtk_rectangle_crop_and_scale (const MtkRectangle *rect, int dst_width, int dst_height, MtkRectangle *dest); + +MTK_EXPORT +void mtk_rectangle_scale_double (const MtkRectangle *rect, + double scale, + MtkRoundingStrategy rounding_strategy, + MtkRectangle *dest); diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index 2eb98a7fe..31417305e 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -1048,10 +1048,10 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex, mtk_rectangle_intersect (&buffer_rect, clip, clip); - meta_rectangle_scale_double (clip, - 1.0 / stex->buffer_scale, - MTK_ROUNDING_STRATEGY_GROW, - clip); + mtk_rectangle_scale_double (clip, + 1.0 / stex->buffer_scale, + MTK_ROUNDING_STRATEGY_GROW, + clip); if (meta_monitor_transform_is_rotated (stex->transform)) { diff --git a/src/core/boxes-private.h b/src/core/boxes-private.h index 3bc36138f..d39a2f876 100644 --- a/src/core/boxes-private.h +++ b/src/core/boxes-private.h @@ -241,12 +241,6 @@ META_EXPORT_TEST gboolean meta_rectangle_is_adjacent_to (MtkRectangle *rect, MtkRectangle *other); -META_EXPORT_TEST -void meta_rectangle_scale_double (const MtkRectangle *rect, - double scale, - MtkRoundingStrategy rounding_strategy, - MtkRectangle *dest); - META_EXPORT_TEST void meta_rectangle_transform (const MtkRectangle *rect, MetaMonitorTransform transform, diff --git a/src/core/boxes.c b/src/core/boxes.c index 6b54318fe..90f6ae66c 100644 --- a/src/core/boxes.c +++ b/src/core/boxes.c @@ -1849,19 +1849,6 @@ meta_rectangle_is_adjacent_to (MtkRectangle *rect, return FALSE; } -void -meta_rectangle_scale_double (const MtkRectangle *rect, - double scale, - MtkRoundingStrategy rounding_strategy, - MtkRectangle *dest) -{ - graphene_rect_t tmp = GRAPHENE_RECT_INIT (rect->x, rect->y, - rect->width, rect->height); - - graphene_rect_scale (&tmp, scale, scale, &tmp); - mtk_rectangle_from_graphene_rect (&tmp, rounding_strategy, dest); -} - /** * meta_rectangle_transform: * @rect: the #MtkRectangle to be transformed