matrix: drop rotation

It's unused.
This commit is contained in:
Simon Ser 2025-01-26 17:55:28 +01:00
parent 7d1f535e49
commit 211eb9d60e
3 changed files with 4 additions and 25 deletions

View file

@ -18,9 +18,6 @@ void wlr_matrix_translate(float mat[static 9], float x, float y);
/** Writes a 2D scale matrix to mat of magnitude (x, y) */
void wlr_matrix_scale(float mat[static 9], float x, float y);
/** Writes a 2D rotation matrix to mat at an angle of rad radians */
void wlr_matrix_rotate(float mat[static 9], float rad);
/** Writes a transformation matrix which applies the specified
* wl_output_transform to mat */
void wlr_matrix_transform(float mat[static 9],
@ -31,8 +28,7 @@ void wlr_matrix_transform(float mat[static 9],
* rotation. The result is written to mat, which can be applied to each
* coordinate of the box to get a new coordinate from [-1,1]. */
void wlr_matrix_project_box(float mat[static 9], const struct wlr_box *box,
enum wl_output_transform transform, float rotation,
const float projection[static 9]);
enum wl_output_transform transform, const float projection[static 9]);
/**
* Writes a 2D orthographic projection matrix to mat of (width, height) with a

View file

@ -620,7 +620,7 @@ static void render_pass_add_rect(struct wlr_render_pass *wlr_pass,
case WLR_RENDER_BLEND_MODE_PREMULTIPLIED:;
float proj[9], matrix[9];
wlr_matrix_identity(proj);
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, 0, proj);
wlr_matrix_project_box(matrix, &box, WL_OUTPUT_TRANSFORM_NORMAL, proj);
wlr_matrix_multiply(matrix, pass->projection, matrix);
struct wlr_vk_render_format_setup *setup = pass->srgb_pathway ?
@ -711,7 +711,7 @@ static void render_pass_add_texture(struct wlr_render_pass *wlr_pass,
float proj[9], matrix[9];
wlr_matrix_identity(proj);
wlr_matrix_project_box(matrix, &dst_box, options->transform, 0, proj);
wlr_matrix_project_box(matrix, &dst_box, options->transform, proj);
wlr_matrix_multiply(matrix, pass->projection, matrix);
struct wlr_vk_vert_pcr_data vert_pcr_data = {

View file

@ -1,4 +1,3 @@
#include <math.h>
#include <string.h>
#include <wayland-server-protocol.h>
#include <wlr/types/wlr_output.h>
@ -51,15 +50,6 @@ void wlr_matrix_scale(float mat[static 9], float x, float y) {
wlr_matrix_multiply(mat, mat, scale);
}
void wlr_matrix_rotate(float mat[static 9], float rad) {
float rotate[9] = {
cos(rad), -sin(rad), 0.0f,
sin(rad), cos(rad), 0.0f,
0.0f, 0.0f, 1.0f,
};
wlr_matrix_multiply(mat, mat, rotate);
}
static const float transforms[][9] = {
[WL_OUTPUT_TRANSFORM_NORMAL] = {
1.0f, 0.0f, 0.0f,
@ -131,8 +121,7 @@ void matrix_projection(float mat[static 9], int width, int height,
}
void wlr_matrix_project_box(float mat[static 9], const struct wlr_box *box,
enum wl_output_transform transform, float rotation,
const float projection[static 9]) {
enum wl_output_transform transform, const float projection[static 9]) {
int x = box->x;
int y = box->y;
int width = box->width;
@ -141,12 +130,6 @@ void wlr_matrix_project_box(float mat[static 9], const struct wlr_box *box,
wlr_matrix_identity(mat);
wlr_matrix_translate(mat, x, y);
if (rotation != 0) {
wlr_matrix_translate(mat, width/2, height/2);
wlr_matrix_rotate(mat, rotation);
wlr_matrix_translate(mat, -width/2, -height/2);
}
wlr_matrix_scale(mat, width, height);
if (transform != WL_OUTPUT_TRANSFORM_NORMAL) {