mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
Merge branch 'master' into feature/multiseat
This commit is contained in:
commit
2a9dc60f28
27 changed files with 375 additions and 93 deletions
|
|
@ -20,10 +20,13 @@ static void render_surface(struct wlr_surface *surface,
|
|||
struct roots_desktop *desktop, struct wlr_output *wlr_output,
|
||||
struct timespec *when, double lx, double ly, float rotation) {
|
||||
if (surface->texture->valid) {
|
||||
int width = surface->current->buffer_width;
|
||||
int height = surface->current->buffer_height;
|
||||
float scale_factor = (float)wlr_output->scale / surface->current->scale;
|
||||
int width = surface->current->buffer_width * scale_factor;
|
||||
int height = surface->current->buffer_height * scale_factor;
|
||||
double ox = lx, oy = ly;
|
||||
wlr_output_layout_output_coords(desktop->layout, wlr_output, &ox, &oy);
|
||||
ox *= wlr_output->scale;
|
||||
oy *= wlr_output->scale;
|
||||
|
||||
if (wlr_output_layout_intersects(desktop->layout, wlr_output,
|
||||
lx, ly, lx + width, ly + height)) {
|
||||
|
|
@ -32,15 +35,22 @@ static void render_surface(struct wlr_surface *surface,
|
|||
float translate_origin[16];
|
||||
wlr_matrix_translate(&translate_origin,
|
||||
(int)ox + width / 2, (int)oy + height / 2, 0);
|
||||
|
||||
float rotate[16];
|
||||
wlr_matrix_rotate(&rotate, rotation);
|
||||
|
||||
float translate_center[16];
|
||||
wlr_matrix_translate(&translate_center, -width / 2, -height / 2, 0);
|
||||
|
||||
float scale[16];
|
||||
wlr_matrix_scale(&scale, width, height, 1);
|
||||
|
||||
float transform[16];
|
||||
wlr_matrix_mul(&translate_origin, &rotate, &transform);
|
||||
wlr_matrix_mul(&transform, &translate_center, &transform);
|
||||
wlr_surface_get_matrix(surface, &matrix,
|
||||
&wlr_output->transform_matrix, &transform);
|
||||
wlr_matrix_mul(&transform, &scale, &transform);
|
||||
wlr_matrix_mul(&wlr_output->transform_matrix, &transform, &matrix);
|
||||
|
||||
wlr_render_with_matrix(desktop->server->renderer,
|
||||
surface->texture, &matrix);
|
||||
|
||||
|
|
@ -220,6 +230,7 @@ void output_add_notify(struct wl_listener *listener, void *data) {
|
|||
if (output_config->mode.width) {
|
||||
set_mode(wlr_output, output_config);
|
||||
}
|
||||
wlr_output->scale = output_config->scale;
|
||||
wlr_output_transform(wlr_output, output_config->transform);
|
||||
wlr_output_layout_add(desktop->layout,
|
||||
wlr_output, output_config->x, output_config->y);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue