Skip to content

Conversation

@madsmtm
Copy link
Member

@madsmtm madsmtm commented Jan 31, 2026

To make it a bit clearer that the buffer borrows from the surface.

To make it clearer that the buffer borrows from the surface.
@madsmtm madsmtm requested a review from notgull as a code owner January 31, 2026 23:27
@madsmtm madsmtm added the documentation Improvements or additions to documentation label Jan 31, 2026
Comment on lines -249 to +250
pub struct Buffer<'a> {
buffer_impl: BufferDispatch<'a>,
pub struct Buffer<'surface> {
buffer_impl: BufferDispatch<'surface>,
Copy link
Member Author

Choose a reason for hiding this comment

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

We can also go with 's if you think 'surface is too verbose?

Copy link
Member

Choose a reason for hiding this comment

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

No issues with the verbosity here.

@madsmtm madsmtm merged commit 468cf78 into master Feb 1, 2026
40 checks passed
@madsmtm madsmtm deleted the madsmtm/rename-buffer-lifetime branch February 1, 2026 01:27
@MarijnS95
Copy link
Member

I thought that we wanted to detach the Buffer from Surface entirely and let the user allocate+manage+present these (not sure which concrete issue), but that fundamentally requires a separate type as it is incompatible with the current "lock()"-like APIs.

#222 (comment) appears to be somewhat related, though with the caveat that I'd still let "the Context" allocate a backend-specific Buffer that's initially unowned/dissociated from a Surface (#306 (comment)).

@madsmtm
Copy link
Member Author

madsmtm commented Feb 1, 2026

I thought that we wanted to detach the Buffer from Surface entirely and let the user allocate+manage+present these (not sure which concrete issue), but that fundamentally requires a separate type as it is incompatible with the current "lock()"-like APIs.

Yeah, I'm not sure how / if we're going to square that circle, so I did this for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Development

Successfully merging this pull request may close these issues.

4 participants