mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-30 00:15:58 +01:00
optimize a bit rootston renderer if there's no surface transform
This commit is contained in:
parent
d1b29a54b9
commit
eb763439f7
1 changed files with 17 additions and 13 deletions
|
@ -63,6 +63,12 @@ static void render_surface(struct wlr_surface *surface,
|
||||||
float scale[16];
|
float scale[16];
|
||||||
wlr_matrix_scale(&scale, render_width, render_height, 1);
|
wlr_matrix_scale(&scale, render_width, render_height, 1);
|
||||||
|
|
||||||
|
float transform[16];
|
||||||
|
wlr_matrix_mul(&translate_center, &rotate, &transform);
|
||||||
|
wlr_matrix_mul(&transform, &translate_origin, &transform);
|
||||||
|
wlr_matrix_mul(&transform, &scale, &transform);
|
||||||
|
|
||||||
|
if (surface->current->transform != WL_OUTPUT_TRANSFORM_NORMAL) {
|
||||||
float surface_translate_center[16];
|
float surface_translate_center[16];
|
||||||
wlr_matrix_translate(&surface_translate_center, 0.5, 0.5, 0);
|
wlr_matrix_translate(&surface_translate_center, 0.5, 0.5, 0);
|
||||||
|
|
||||||
|
@ -73,14 +79,12 @@ static void render_surface(struct wlr_surface *surface,
|
||||||
float surface_translate_origin[16];
|
float surface_translate_origin[16];
|
||||||
wlr_matrix_translate(&surface_translate_origin, -0.5, -0.5, 0);
|
wlr_matrix_translate(&surface_translate_origin, -0.5, -0.5, 0);
|
||||||
|
|
||||||
float transform[16];
|
wlr_matrix_mul(&transform, &surface_translate_center,
|
||||||
wlr_matrix_mul(&translate_center, &rotate, &transform);
|
&transform);
|
||||||
wlr_matrix_mul(&transform, &translate_origin, &transform);
|
|
||||||
wlr_matrix_mul(&transform, &scale, &transform);
|
|
||||||
|
|
||||||
wlr_matrix_mul(&transform, &surface_translate_center, &transform);
|
|
||||||
wlr_matrix_mul(&transform, &surface_transform, &transform);
|
wlr_matrix_mul(&transform, &surface_transform, &transform);
|
||||||
wlr_matrix_mul(&transform, &surface_translate_origin, &transform);
|
wlr_matrix_mul(&transform, &surface_translate_origin,
|
||||||
|
&transform);
|
||||||
|
}
|
||||||
|
|
||||||
wlr_matrix_mul(&wlr_output->transform_matrix, &transform, &matrix);
|
wlr_matrix_mul(&wlr_output->transform_matrix, &transform, &matrix);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue