-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Use own EGL context for Flutter #170045
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
Use own EGL context for Flutter #170045
Conversation
Previously we were using GdkGLContext from GtkGLArea. This would not work if we wanted to start a Flutter engine without a view, as we can't created a GdkGLContext without a GdkWindow. Flutter now renders into its own context(s), and then we access these in the GtkGLArea using EGLImage. It is expected that EGLImage is widely available in all drivers. We also now composite and copy the framebuffer received from Flutter, as GTK will not present it until it is ready. This adds an additional copy, but should have probably always been done in case Flutter wrote to this framebuffer before GTK had used it.
d9585d2 to
656eb56
Compare
|
This is crashing in the driver when running under X11 currently... It otherwise is working on Wayland. |
|
The crash on X11 is due to it using GLX instead of EGL, so EGLImage is not available. Trying to work out alternative ways to get this to work on X11 or if we limit X11 to single window. |
Would |
I don't think so, as the pixmap would be in the GLX context and not accessible from the EGL context. |
|
Ok then you'll want to create a new context and look at |
…added (#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by #170045
…added (flutter#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by flutter#170045
|
#172090 contains the use of EGLImage, which is part of what this PR was doing. I'll refactor this PR to build on that when it lands. |
|
Replaced by #172330 |
…added (flutter#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by flutter#170045
…added (flutter#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by flutter#170045
…added (flutter#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by flutter#170045
…added (flutter#171409) Software rendering was added in a79827a. It accidentally removed the different GL initialization for secondary views (which need to copy the contents from the primary view). This is not a heavily used feature yet, as multi-window support is still in progress. This secondary codepath is in the process of being removed by flutter#170045
Previously we were using GdkGLContext from GtkGLArea. This would not work if we wanted to start a Flutter engine without a view, as we can't created a GdkGLContext without a GdkWindow.
Flutter now renders into its own context(s), and then we access these in the GtkGLArea using EGLImage. It is expected that EGLImage is widely available in all drivers.
We also now composite and copy the framebuffer received from Flutter, as GTK will not present it until it is ready. This adds an additional copy, but should have probably always been done in case Flutter wrote to this framebuffer before GTK had used it.