diff options
author | emersion <contact@emersion.fr> | 2017-12-01 16:20:09 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-12-01 16:20:09 +0100 |
commit | eb763439f75d3c9174280d0c75ef44941dd99340 (patch) | |
tree | a62bc3a2bef31cfb093b93468e7c401b7ead0d6f /rootston | |
parent | d1b29a54b92c5d13739430fe98b12ff169964272 (diff) |
optimize a bit rootston renderer if there's no surface transform
Diffstat (limited to 'rootston')
-rw-r--r-- | rootston/output.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/rootston/output.c b/rootston/output.c index 9df95a91..996f819d 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -63,24 +63,28 @@ static void render_surface(struct wlr_surface *surface, float scale[16]; wlr_matrix_scale(&scale, render_width, render_height, 1); - float surface_translate_center[16]; - wlr_matrix_translate(&surface_translate_center, 0.5, 0.5, 0); - - float surface_transform[16]; - wlr_matrix_transform(surface_transform, - wlr_output_transform_invert(surface->current->transform)); - - float surface_translate_origin[16]; - wlr_matrix_translate(&surface_translate_origin, -0.5, -0.5, 0); - float transform[16]; wlr_matrix_mul(&translate_center, &rotate, &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_translate_origin, &transform); + if (surface->current->transform != WL_OUTPUT_TRANSFORM_NORMAL) { + float surface_translate_center[16]; + wlr_matrix_translate(&surface_translate_center, 0.5, 0.5, 0); + + float surface_transform[16]; + wlr_matrix_transform(surface_transform, + wlr_output_transform_invert(surface->current->transform)); + + float surface_translate_origin[16]; + wlr_matrix_translate(&surface_translate_origin, -0.5, -0.5, 0); + + wlr_matrix_mul(&transform, &surface_translate_center, + &transform); + wlr_matrix_mul(&transform, &surface_transform, &transform); + wlr_matrix_mul(&transform, &surface_translate_origin, + &transform); + } wlr_matrix_mul(&wlr_output->transform_matrix, &transform, &matrix); |