[PATCH weston v2 19/20] renderers: use weston_view_to_output_matrix() in renderers
Derek Foreman
derekf at osg.samsung.com
Thu Oct 16 08:55:37 PDT 2014
We now use this function in the gl renderer to determine if linear
filtering is required, and in the pixman renderer to set up the image
transformation.
---
src/gl-renderer.c | 9 ++-------
src/pixman-renderer.c | 14 +-------------
2 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index e1ad5ca..5b2f267 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -562,13 +562,8 @@ draw_view(struct weston_view *ev, struct weston_output *output,
use_shader(gr, gs->shader);
shader_uniforms(gs->shader, ev, output);
- transform = ev->surface->buffer_to_surface_matrix;
- if (ev->transform.enabled)
- weston_matrix_multiply(&transform, &ev->transform.matrix);
- else
- weston_matrix_translate(&transform,
- ev->geometry.x, ev->geometry.y, 0);
- weston_matrix_multiply(&transform, &output->matrix);
+
+ weston_view_to_output_matrix(ev, output, false, &transform);
if (weston_matrix_needs_filtering(&transform))
filter = GL_LINEAR;
diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index f6fe3c7..b682639 100644
--- a/src/pixman-renderer.c
+++ b/src/pixman-renderer.c
@@ -198,19 +198,7 @@ repaint_region(struct weston_view *ev, struct weston_output *output,
/* And clip to it */
pixman_image_set_clip_region32 (po->shadow_image, &final_region);
- /* Set up the source transformation based on the surface
- position, the output position/transform/scale and the client
- specified buffer transform/scale */
- weston_matrix_invert(&matrix, &output->matrix);
-
- if (ev->transform.enabled) {
- weston_matrix_multiply(&matrix, &ev->transform.inverse);
- } else {
- weston_matrix_translate(&matrix,
- -ev->geometry.x, -ev->geometry.y, 0);
- }
-
- weston_matrix_multiply(&matrix, &ev->surface->surface_to_buffer_matrix);
+ weston_view_to_output_matrix(ev, output, true, &matrix);
weston_matrix_to_pixman_transform(&transform, &matrix);
pixman_image_set_transform(ps->image, &transform);
--
2.1.1
More information about the wayland-devel
mailing list