pixman-renderer: add view_transformation_is_translation()

A simple refactoring just to help readability.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
dev
Pekka Paalanen 10 years ago
parent 6ea523b85d
commit 23d4af5969
  1. 16
      src/pixman-renderer.c

@ -180,6 +180,18 @@ pixman_renderer_compute_transform(pixman_transform_t *transform_out,
weston_matrix_to_pixman_transform(transform_out, &matrix); weston_matrix_to_pixman_transform(transform_out, &matrix);
} }
static bool
view_transformation_is_translation(struct weston_view *view)
{
if (!view->transform.enabled)
return true;
if (view->transform.matrix.type <= WESTON_MATRIX_TRANSFORM_TRANSLATE)
return true;
return false;
}
static void static void
repaint_region(struct weston_view *ev, struct weston_output *output, repaint_region(struct weston_view *ev, struct weston_output *output,
pixman_region32_t *region, pixman_region32_t *surf_region, pixman_region32_t *region, pixman_region32_t *surf_region,
@ -305,9 +317,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
} }
/* TODO: Implement repaint_region_complex() using pixman_composite_trapezoids() */ /* TODO: Implement repaint_region_complex() using pixman_composite_trapezoids() */
if (ev->alpha != 1.0 || if (ev->alpha != 1.0 || !view_transformation_is_translation(ev)) {
(ev->transform.enabled &&
ev->transform.matrix.type != WESTON_MATRIX_TRANSFORM_TRANSLATE)) {
repaint_region(ev, output, &repaint, NULL, PIXMAN_OP_OVER); repaint_region(ev, output, &repaint, NULL, PIXMAN_OP_OVER);
} else { } else {
/* blended region is whole surface minus opaque region: */ /* blended region is whole surface minus opaque region: */

Loading…
Cancel
Save