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

Use separate pixmaps for each edge of a container (#3479) #5430

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

buchankn
Copy link

This pull request fixes #3479.

i3 currently allocates one big pixmap for an entire window, but only draws on the edges of the pixmap. This code allocates four separate pixmaps for each edge of the window (a 'sparse surface'), thereby using less memory.

To ensure 'correctness', any drawing operation is performed on each of the four edge pixmaps, so that any operation that crosses pixmap boundaries will be drawn correctly. Note that any draws outside the pixmap boundary will just be clipped. This may not be the most efficient way to handle this, and could possibly be optimized, but I was going for correctness in this case. I'm open to suggestions on this...

@orestisfl
Copy link
Member

Great attempt but this creates artifacts for me in the borders.

Before:
screenshot-2024-05-17T22:42:44 CEST

After:
screenshot-2024-05-17T22:42:21 CEST

*
*/
void sparse_surface_copy(sparse_surface_t *src_sparse, surface_t *dest, double src_x, double src_y,
double dest_x, double dest_y, double width, double height) {
Copy link
Member

Choose a reason for hiding this comment

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

width and height ignored here.

@orestisfl orestisfl added the waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment. label May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use separate pixmaps for each edge of a container
2 participants