pixels: Ensure expected formats when accesing bytes of snapshot#37767
Merged
sagudev merged 7 commits intoservo:mainfrom Jul 3, 2025
Merged
pixels: Ensure expected formats when accesing bytes of snapshot#37767sagudev merged 7 commits intoservo:mainfrom
sagudev merged 7 commits intoservo:mainfrom
Conversation
ca10e34 to
5f21c65
Compare
Member
Author
This change should not change any behavior. Just make existing expectations more explicit. |
Member
|
Yeah, it seems it's unaffected. Feel free to merge it! |
Member
Author
|
gentle nudge @mrobinson |
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Member
Author
|
rebased |
mrobinson
approved these changes
Jul 3, 2025
Member
mrobinson
left a comment
There was a problem hiding this comment.
Looks good, with two changes:
Co-authored-by: Martin Robinson <[email protected]> Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
mrobinson
approved these changes
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I introduced snapshot in #36119 to pack raw bytes and metadata together, now we take the next step and require for user to always specify what kind of byte data they want when calling
as_bytesorto_vec(basically joining transform and data). There are also valid usages when one might require just one property of bytes (textures can generally handle both RGBA and BGRA). There are also valid usages of using just raw bytes (when cropping). This PR tries to make such usages more obvious.This will make it easier to fix stuff around 2d canvas (we do not want to assume any bytes properties in abstraction).
Testing: Code is covered by WPT tests.