aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-03-15 21:22:34 +0100
committerLibravatar emersion <contact@emersion.fr>2018-03-15 21:22:34 +0100
commit1004915796cf6d416124c6b3e92317b15d0c1424 (patch)
tree2fe92514ce2547a3ef1b9a4e2e66d99315da3857 /sway/desktop/output.c
parentMerge pull request #1622 from emersion/wlroots-subproject-fallback (diff)
downloadsway-1004915796cf6d416124c6b3e92317b15d0c1424.tar.gz
sway-1004915796cf6d416124c6b3e92317b15d0c1424.tar.zst
sway-1004915796cf6d416124c6b3e92317b15d0c1424.zip
Update rendering code for wlroots matrix redesign
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c20
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);