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

[CP][Impeller] ensure that OpenGL "flipped" textures do not leak via texture readback. (#163501) #163667

Merged

Conversation

jonahwilliams
Copy link
Member

Fixes #163315 Fixes #163521 Fixes #142641

OpenGL has an inverted coordinate system (bottom left is zero) compared to Metal/Vulkan (top left is zero). We handle this by rendering things upside down on OpenGL. Unfortunately this can leak out of the renderer via readback (toImage), so we need to make sure to undo the inversion.

This is not performed for the "TextureCoordinateSystem::kUploadFromHost" state as that indicates the texture is already "right side up".

…ure readback. (flutter#163501)

Fixes flutter#163315
Fixes flutter#163521
Fixes flutter#142641

OpenGL has an inverted coordinate system (bottom left is zero) compared
to Metal/Vulkan (top left is zero). We handle this by rendering things
upside down on OpenGL. Unfortunately this can leak out of the renderer
via readback (toImage), so we need to make sure to undo the inversion.

This is not performed for the "TextureCoordinateSystem::kUploadFromHost"
state as that indicates the texture is already "right side up".
@github-actions github-actions bot added engine flutter/engine repository. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Feb 19, 2025
@jonahwilliams jonahwilliams added cp: review Cherry-picks in the review queue cp: stable cherry pick this pull request to stable release candidate branch and removed engine flutter/engine repository. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Feb 19, 2025
@github-actions github-actions bot added engine flutter/engine repository. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Feb 19, 2025
@jonahwilliams
Copy link
Member Author

Ah I used an API that is not in the release branch. Fixing.

@justinmc
Copy link
Contributor

The presubmits were fixed in #164050. Pushing a merge commit to see if this PR will pass now.

@justinmc justinmc added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 26, 2025
@auto-submit auto-submit bot merged commit a8a9ded into flutter:flutter-3.29-candidate.0 Feb 26, 2025
156 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App cp: review Cherry-picks in the review queue cp: stable cherry pick this pull request to stable release candidate branch e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants