mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
scene/surface: Do not use buffer dimensions for clip
The surface's buffer dimensions were used to scale the clip's x/y offset. If a surface had a larger buffer than src_box, the calculations to scale the x/y portion of the clip would be incorrect, yielding graphical glitches. This was noticed with Chromium in sway, which during resize uses a viewport with a src_box to avoid immediate buffer reallocation. While the viewport was in use, the surface would be shifted so that too much content was cropped in the upper left, and damage glitching was visible in the lower right. Use the buffer source box dimensions instead.
This commit is contained in:
parent
edd8df76d8
commit
dc7dba8b1f
1 changed files with 2 additions and 2 deletions
|
|
@ -129,8 +129,8 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
||||||
buffer_width, buffer_height);
|
buffer_width, buffer_height);
|
||||||
wlr_output_transform_coords(state->transform, &buffer_width, &buffer_height);
|
wlr_output_transform_coords(state->transform, &buffer_width, &buffer_height);
|
||||||
|
|
||||||
src_box.x += (double)(clip->x * buffer_width) / state->width;
|
src_box.x += (double)(clip->x * src_box.width) / state->width;
|
||||||
src_box.y += (double)(clip->y * buffer_height) / state->height;
|
src_box.y += (double)(clip->y * src_box.height) / state->height;
|
||||||
src_box.width *= (double)width / state->width;
|
src_box.width *= (double)width / state->width;
|
||||||
src_box.height *= (double)height / state->height;
|
src_box.height *= (double)height / state->height;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue