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

allow SkImage::asyncRescaleAndReadPixels() to work async on WebGL #169

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

jamesruan
Copy link

Reading back pixels is blocking on WebGL. This is because skia lacks pixel transfer support with out mapping.

WebGL has PBO for async reading, however it use glGetBufferSubData() to read back from PIXEL_PACK_BUFFER instead of mapping

  • add GetBufferSubData to GrGLInterface
  • add GrGpuBuffer::getData()
  • TAsyncReadResult use getData() to copy pixels to cpu plane

Reading back pixels is blocking on WebGL. This is because skia lacks pixel
transfer support with out mapping.

WebGL has PBO for async reading, however it use `glGetBufferSubData()` to read
back from PIXEL_PACK_BUFFER instead of mapping

- add GetBufferSubData to GrGLInterface
- add GrGpuBuffer::getData()
- TAsyncReadResult use getData() to copy pixels to cpu plane
@skia-codereview-bot
Copy link
Collaborator

This PR (HEAD: 3036904) has been imported to Gerrit for code review.

Please visit review.skia.org/833776 to see it. Please CC yourself to the Gerrit change.

Note:

  • Skia uses only Gerrit for reviews and submitting code (doc).
  • All comments are handled within Gerrit. Any comments on the GitHub PR will be ignored.
  • The PR author can continue to upload commits to the branch used by the PR in order to address feedback from Gerrit.
  • Once the code is ready to be merged, a maintainer will submit the change on Gerrit and skia-codereview-bot will close this PR.
  • Similarly, if a change is abandoned on Gerrit, the corresponding PR will be closed with a note.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants