Skip to content

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

Open
buchankn wants to merge 2 commits into
i3:nextfrom
buchankn:next
Open

Use separate pixmaps for each edge of a container (#3479)#5430
buchankn wants to merge 2 commits into
i3:nextfrom
buchankn:next

Conversation

@buchankn
Copy link
Copy Markdown

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
Copy Markdown
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

Comment thread src/sparse_surface.c
*
*/
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
Copy Markdown
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