[PATCH weston v2 12/16] pixman-renderer: add view_transformation_is_translation()
Pekka Paalanen
ppaalanen at gmail.com
Tue Mar 10 06:01:43 PDT 2015
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
A simple refactoring just to help readability.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
Reviewed-By: Derek Foreman <derekf at osg.samsung.com>
---
src/pixman-renderer.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index 96123cb..f675042 100644
--- a/src/pixman-renderer.c
+++ b/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);
}
+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
region_intersect_only_translation(pixman_region32_t *result_global,
pixman_region32_t *global,
@@ -310,9 +322,7 @@ draw_view(struct weston_view *ev, struct weston_output *output,
}
/* TODO: Implement repaint_region_complex() using pixman_composite_trapezoids() */
- if (ev->alpha != 1.0 ||
- (ev->transform.enabled &&
- ev->transform.matrix.type != WESTON_MATRIX_TRANSFORM_TRANSLATE)) {
+ if (ev->alpha != 1.0 || !view_transformation_is_translation(ev)) {
repaint_region(ev, output, &repaint, NULL, PIXMAN_OP_OVER);
} else {
/* blended region is whole surface minus opaque region: */
--
2.0.5
More information about the wayland-devel
mailing list