Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply transform to damage before blitting #986

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

wash2
Copy link
Contributor

@wash2 wash2 commented Nov 13, 2024

There seems to be something off about the types of damage being passed around for screencopy. The screencopy damage is clipped because it isn't rotated, so for a rotated screen 1920x1080, it becomes 1080x1080 in blit_frame_result when intersected with the dmabuf geometry. This fix can be tested with pop-os/xdg-desktop-portal-cosmic#105 but this is really just a bandaid. Maybe blit_frame_result shouldn't be taking physical damage, because it copies buffer to buffer? I think the dmabuf geometry used in blit_frame_result seems like it should be Buffer too, but I'm not as familiar with smithay.

@wash2 wash2 requested a review from Drakulix November 13, 2024 05:22
Copy link
Member

@Drakulix Drakulix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe blit_frame_result shouldn't be taking physical damage, because it copies buffer to buffer?

Yeah, you are absolutely right. Either it should also take a Transform, if it has to work with Physical coordinates for some reason and handle the necessary conversion internally or it should just take Buffer-coordinates (which I think would be the proper solution here).

Feel free to also make a smithay PR or at least open an issue please to track this and start a discussion.

.to_logical(1)
.to_buffer(1, output_transform)
.to_logical(1, Transform::Normal)
.to_physical(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, yeah this is ugly.

I think if would possibly a bit cleaner to transform this already in line 1006 https://github.com/pop-os/cosmic-comp/pull/986/files#diff-85c7861d0290a1e31c47e8e1d31b15f37d2bb03a1b4edb046d9173eef8c9f758R1006 .
But given this is quite a hack anyway, we don't have to bother.

@Drakulix Drakulix merged commit 8d5541b into master Nov 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants