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

add BackendTexture and Image.adoptTextureFrom #1030

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MaapuH
Copy link

@MaapuH MaapuH commented Mar 1, 2025

New:

(related #1019)

  1. Adds bindings to GrBackendTextures::MakeGL
  2. Adds bindings to SkImages::AdoptTextureFrom
  3. Adds bindings to GrBackendTextures::GLTextureParametersModdified

Changes in build scripts:

(related #742)

  1. Add file paths treating if building on Windows machine
  2. Use "emcc.bat" instead of "emcc" if building on Windows machine, as described on Emscripten website

Use-case:

Allows skia to draw images, rendered externally on gpu.
Compose would benefit greatly, allowing to embed VideoPlayer or Browser without any friction or need to use Swing.

@MatkovIvan MatkovIvan requested a review from igordmn March 7, 2025 09:10
@MaapuH
Copy link
Author

MaapuH commented Mar 7, 2025

Besides already implemented above, at the moment I am working on these new bindings:
DirectContext.createBackendTexture() // this is common for all backends
DirectContext.deleteBackendTexture() // this is common for all backends

BackendTexture.backend // allows to check which backend is texture created on
BackendTexture.getGLInfo // allows to get id of the texture if the backend is GL, this we can use for external rendering

We can also getDirect3DInfo for DirectX backend, getMetalInfo for Metal, etc
These I'll be doing when I'm done with GL bindings

I will submit another PR when all the upcoming bindigs are implemented

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

Successfully merging this pull request may close these issues.

1 participant