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

gtk4: implement custom Widget for WebView rendering #276

Open
philn opened this issue Mar 8, 2021 · 3 comments
Open

gtk4: implement custom Widget for WebView rendering #276

philn opened this issue Mar 8, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@philn
Copy link
Member

philn commented Mar 8, 2021

As a future improvement idea, I suppose that instead of using GtkGLArea maybe it could be possible to implement a GtkWidget which would use gtk_snapshot_append_texture() to directly pass the GL texture, and let GTK do the compositing—we would not need to provide shaders to scan out the texture when painting a quad using GL calls, and if I understand correctly it should be faster because GtkGLArea paints to a FBO backed by a texture, and then that texture is snapshotted by the `GtkGLArea widget implementation.

Originally posted by @aperezdc in #262 (comment)

@aperezdc aperezdc added the enhancement New feature or request label Mar 9, 2021
@philn
Copy link
Member Author

philn commented Apr 19, 2021

With the current approach we can't select text. I think we should consider this new approach sooner than later :)

@philn
Copy link
Member Author

philn commented Apr 19, 2021

With the current approach we can't select text. I think we should consider this new approach sooner than later :)

Ah well, maybe a different rendering approach wouldn't help much with this specific issue.

@aperezdc
Copy link
Member

This comment in the GTK GitLab shows how to import a DMA-BUF as a texture that then can be passed to GTK as an snapshot. It should work both for Wayland and X11 after this change in GTK to prefer EGL.

(Of course it should be possible to use EGLImage, there is no need to go all-in and use DMA-BUF to implement a widget, but it seemed interesting to share.)

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

No branches or pull requests

2 participants