mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-22 06:59:44 -05: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.
(cherry picked from commit dc7dba8b1f)
This commit is contained in:
parent
766a228da4
commit
f57e7e40d3
1 changed files with 2 additions and 2 deletions
|
|
@ -128,8 +128,8 @@ static void surface_reconfigure(struct wlr_scene_surface *scene_surface) {
|
|||
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.y += (double)(clip->y * buffer_height) / state->height;
|
||||
src_box.x += (double)(clip->x * src_box.width) / state->width;
|
||||
src_box.y += (double)(clip->y * src_box.height) / state->height;
|
||||
src_box.width *= (double)width / state->width;
|
||||
src_box.height *= (double)height / state->height;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue