diff --git a/libweston/backend.h b/libweston/backend.h index 2374b17bd..e421c660c 100644 --- a/libweston/backend.h +++ b/libweston/backend.h @@ -172,8 +172,9 @@ weston_output_transform_coordinate(struct weston_output *output, double *x, double *y); void -weston_output_region_from_global(struct weston_output *output, - pixman_region32_t *region); +weston_region_global_to_output(pixman_region32_t *dst, + struct weston_output *output, + pixman_region32_t *src); const struct weston_hdr_metadata_type1 * weston_output_get_hdr_metadata_type1(const struct weston_output *output); diff --git a/libweston/compositor.c b/libweston/compositor.c index 98eafdf6f..d1e0cbd8a 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -6202,10 +6202,11 @@ weston_compositor_reflow_outputs(struct weston_compositor *compositor, } } -/** Transform a region in-place from global to output coordinates +/** Transform a region from global to output coordinates * + * \param dst The region transformed into output coordinates * \param output The output that defines the transformation. - * \param region The region to be transformed in-place. + * \param src The region to be transformed, in global coordinates. * * This takes a region in the global coordinate system, and takes into account * output position, transform and scale, and converts the region into output @@ -6215,10 +6216,11 @@ weston_compositor_reflow_outputs(struct weston_compositor *compositor, * \ingroup output */ WL_EXPORT void -weston_output_region_from_global(struct weston_output *output, - pixman_region32_t *region) +weston_region_global_to_output(pixman_region32_t *dst, + struct weston_output *output, + pixman_region32_t *src) { - weston_matrix_transform_region(region, &output->matrix, region); + weston_matrix_transform_region(dst, &output->matrix, src); } static void diff --git a/libweston/pixman-renderer.c b/libweston/pixman-renderer.c index 62c2cb15b..d6ad4379e 100644 --- a/libweston/pixman-renderer.c +++ b/libweston/pixman-renderer.c @@ -414,8 +414,9 @@ draw_view_translated(struct weston_view *view, struct weston_output *output, repaint_global, &surface->opaque, view); - weston_output_region_from_global(output, - &repaint_output); + weston_region_global_to_output(&repaint_output, + output, + &repaint_output); repaint_region(view, output, &repaint_output, NULL, PIXMAN_OP_SRC); @@ -426,7 +427,9 @@ draw_view_translated(struct weston_view *view, struct weston_output *output, region_intersect_only_translation(&repaint_output, repaint_global, &surface_blend, view); - weston_output_region_from_global(output, &repaint_output); + weston_region_global_to_output(&repaint_output, + output, + &repaint_output); repaint_region(view, output, &repaint_output, NULL, PIXMAN_OP_OVER); @@ -462,7 +465,8 @@ draw_view_source_clipped(struct weston_view *view, pixman_region32_init(&repaint_output); pixman_region32_copy(&repaint_output, repaint_global); - weston_output_region_from_global(output, &repaint_output); + weston_region_global_to_output(&repaint_output, output, + &repaint_output); repaint_region(view, output, &repaint_output, &buffer_region, PIXMAN_OP_OVER); @@ -555,7 +559,7 @@ copy_to_hw_buffer(struct weston_output *output, pixman_region32_t *region) pixman_region32_init(&output_region); pixman_region32_copy(&output_region, region); - weston_output_region_from_global(output, &output_region); + weston_region_global_to_output(&output_region, output, &output_region); pixman_image_set_clip_region32 (po->hw_buffer, &output_region); pixman_region32_fini(&output_region); diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 3efd805f8..d287ec613 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -1531,7 +1531,8 @@ blit_shadow_to_output(struct weston_output *output, pixman_region32_intersect(&translated_damage, output_damage, &output->region); /* Convert to output pixel coordinates in-place */ - weston_output_region_from_global(output, &translated_damage); + weston_region_global_to_output(&translated_damage, output, + &translated_damage); rects = pixman_region32_rectangles(&translated_damage, &n_rects); for (i = 0; i < n_rects; i++) {