From 9601a2abf024fb8ac400c0df178bb41ec9e5d215 Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Thu, 4 Mar 2021 13:22:28 -0500 Subject: output: improve transform matrix calculation Compute only the transform matrix in the output. The projection matrix will be calculated inside the gles2 renderer when we start rendering. The goal is to help the pixman rendering process. --- backend/x11/output.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'backend/x11') diff --git a/backend/x11/output.c b/backend/x11/output.c index ef2d1c13..406185e3 100644 --- a/backend/x11/output.c +++ b/backend/x11/output.c @@ -415,11 +415,16 @@ static bool output_cursor_to_picture(struct wlr_x11_output *output, .height = height, }; - float projection[9]; - wlr_matrix_projection(projection, width, height, output->wlr_output.transform); + float output_matrix[9]; + wlr_matrix_identity(output_matrix); + if (output->wlr_output.transform != WL_OUTPUT_TRANSFORM_NORMAL) { + wlr_matrix_translate(output_matrix, width / 2.0, height / 2.0); + wlr_matrix_transform(output_matrix, output->wlr_output.transform); + wlr_matrix_translate(output_matrix, - width / 2.0, - height / 2.0); + } float matrix[9]; - wlr_matrix_project_box(matrix, &cursor_box, transform, 0, projection); + wlr_matrix_project_box(matrix, &cursor_box, transform, 0, output_matrix); wlr_renderer_begin(x11->renderer, width, height); wlr_renderer_clear(x11->renderer, (float[]){ 0.0, 0.0, 0.0, 0.0 }); -- cgit v1.2.3