[weston,v2,19/20] renderers: use weston_view_to_output_matrix() in renderers

Submitted by Derek Foreman on Oct. 16, 2014, 3:55 p.m.

Details

Message ID 1413474938-2407-20-git-send-email-derekf@osg.samsung.com
State Changes Requested
Headers show

Not browsing as part of any series.

Commit Message

Derek Foreman Oct. 16, 2014, 3:55 p.m.
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(-)

Patch hide | download patch | download mbox

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);