diff options
author | 2018-03-18 09:41:50 -0400 | |
---|---|---|
committer | 2018-03-18 09:41:50 -0400 | |
commit | 9823a7c6c8cd5556390d2a53f34e30c3689bc6fd (patch) | |
tree | 2fe92514ce2547a3ef1b9a4e2e66d99315da3857 /sway/desktop/output.c | |
parent | Merge pull request #1622 from emersion/wlroots-subproject-fallback (diff) | |
parent | Update rendering code for wlroots matrix redesign (diff) | |
download | sway-9823a7c6c8cd5556390d2a53f34e30c3689bc6fd.tar.gz sway-9823a7c6c8cd5556390d2a53f34e30c3689bc6fd.tar.zst sway-9823a7c6c8cd5556390d2a53f34e30c3689bc6fd.zip |
Merge pull request #1625 from emersion/matrix-redesign
Update rendering code for wlroots matrix redesign
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r-- | sway/desktop/output.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 08fe5877..247c279f 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c | |||
@@ -3,19 +3,19 @@ | |||
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <time.h> | 4 | #include <time.h> |
5 | #include <wayland-server.h> | 5 | #include <wayland-server.h> |
6 | #include <wlr/render.h> | ||
7 | #include <wlr/types/wlr_matrix.h> | ||
6 | #include <wlr/types/wlr_output.h> | 8 | #include <wlr/types/wlr_output.h> |
7 | #include <wlr/types/wlr_surface.h> | 9 | #include <wlr/types/wlr_surface.h> |
8 | #include <wlr/types/wlr_wl_shell.h> | 10 | #include <wlr/types/wlr_wl_shell.h> |
9 | #include <wlr/render.h> | ||
10 | #include <wlr/render/matrix.h> | ||
11 | #include "log.h" | 11 | #include "log.h" |
12 | #include "sway/container.h" | 12 | #include "sway/container.h" |
13 | #include "sway/input/input-manager.h" | ||
14 | #include "sway/input/seat.h" | ||
13 | #include "sway/layout.h" | 15 | #include "sway/layout.h" |
14 | #include "sway/output.h" | 16 | #include "sway/output.h" |
15 | #include "sway/server.h" | 17 | #include "sway/server.h" |
16 | #include "sway/view.h" | 18 | #include "sway/view.h" |
17 | #include "sway/input/input-manager.h" | ||
18 | #include "sway/input/seat.h" | ||
19 | 19 | ||
20 | /** | 20 | /** |
21 | * Rotate a child's position relative to a parent. The parent size is (pw, ph), | 21 | * Rotate a child's position relative to a parent. The parent size is (pw, ph), |
@@ -59,11 +59,11 @@ static void render_surface(struct wlr_surface *surface, | |||
59 | .x = lx, .y = ly, | 59 | .x = lx, .y = ly, |
60 | .width = render_width, .height = render_height | 60 | .width = render_width, .height = render_height |
61 | }; | 61 | }; |
62 | float matrix[16]; | 62 | float matrix[9]; |
63 | wlr_matrix_project_box(&matrix, &render_box, | 63 | wlr_matrix_project_box(matrix, &render_box, surface->current->transform, |
64 | surface->current->transform, 0, &wlr_output->transform_matrix); | 64 | 0, wlr_output->transform_matrix); |
65 | wlr_render_with_matrix(server.renderer, surface->texture, | 65 | wlr_render_texture_with_matrix(server.renderer, surface->texture, |
66 | &matrix, 1.0f); // TODO: configurable alpha | 66 | matrix, 1.0f); // TODO: configurable alpha |
67 | 67 | ||
68 | wlr_surface_send_frame_done(surface, when); | 68 | wlr_surface_send_frame_done(surface, when); |
69 | } | 69 | } |
@@ -183,7 +183,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { | |||
183 | struct sway_server *server = soutput->server; | 183 | struct sway_server *server = soutput->server; |
184 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; | 184 | float clear_color[] = {0.25f, 0.25f, 0.25f, 1.0f}; |
185 | struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); | 185 | struct wlr_renderer *renderer = wlr_backend_get_renderer(wlr_output->backend); |
186 | wlr_renderer_clear(renderer, &clear_color); | 186 | wlr_renderer_clear(renderer, clear_color); |
187 | 187 | ||
188 | int buffer_age = -1; | 188 | int buffer_age = -1; |
189 | wlr_output_make_current(wlr_output, &buffer_age); | 189 | wlr_output_make_current(wlr_output, &buffer_age); |