Repository navigation
Perform OpenGL compositing in the Flutter thread and write to a framebuffer. - #172090
Conversation
…buffer. This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
c2dd984 to
2b60e4c
Compare
mattkae
left a comment
There was a problem hiding this comment.
Cool 🫘 I've got a couple of small nits, but nothing blocking!
|
@richardexfo if possible can you test this on your ARM device and see if the Blit issue is still there? |
|
@bleroux if possible could you test this on your NVIDIA driver and see if the Blit issue is still there? |
|
@robert-ancell I tried your PR and it works (no crash). I also tried on master with a change to the |
Thanks for confirming! I think the original issue was the framebuffer that Flutter was writing into was being used by GTK after Flutter had returned from the present layers callback. Therefore it could be cleared or overwritten if GTK did not do this quickly enough. So this would be timing/hardware dependent. With the change in this PR Flutter writes into a framebuffer owned by the embedder, and that is read by GTK ensuring it is always in a valid state. |
flutter/flutter@c2739f0...9c626d9 2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274) 2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268) 2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269) 2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264) 2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090) 2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261) 2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256) 2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255) 2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253) 2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916) 2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240) 2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243) 2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242) 2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213) 2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187) 2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236) 2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233) 2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…buffer. (flutter#172090) This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
flutter/flutter@c2739f0...9c626d9 2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274) 2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268) 2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269) 2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264) 2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090) 2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261) 2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256) 2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255) 2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253) 2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916) 2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240) 2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243) 2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242) 2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213) 2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187) 2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236) 2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233) 2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…buffer. (flutter#172090) This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
…buffer. (flutter#172090) This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
…buffer. (flutter#172090) This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
…buffer. (flutter#172090) This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window). Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.
flutter/flutter@c2739f0...9c626d9 2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274) 2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268) 2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269) 2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264) 2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090) 2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261) 2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256) 2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255) 2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253) 2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916) 2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240) 2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243) 2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242) 2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213) 2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187) 2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236) 2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233) 2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/flutter@c2739f0...9c626d9 2025-07-17 [email protected] Roll Skia from 5b4afa58289a to 3673a1f26a63 (1 revision) (flutter/flutter#172274) 2025-07-17 [email protected] Roll Fuchsia Linux SDK from JRFUXSNXExcfjVYvA... to HXdm7P0a4ZJVm_TE-... (flutter/flutter#172268) 2025-07-17 [email protected] Roll Dart SDK from d71df90177e4 to 486f9c0663bc (1 revision) (flutter/flutter#172269) 2025-07-17 [email protected] Roll Skia from 3ad1aace3e02 to 5b4afa58289a (3 revisions) (flutter/flutter#172264) 2025-07-17 [email protected] Perform OpenGL compositing in the Flutter thread and write to a framebuffer. (flutter/flutter#172090) 2025-07-17 [email protected] Licenses cpp 716 (flutter/flutter#172261) 2025-07-16 [email protected] Remove emoji from ci.yaml, because we still live with CP1252 for some silly reason (flutter/flutter#172256) 2025-07-16 [email protected] Roll Skia from bf3f9b77d3a8 to 3ad1aace3e02 (11 revisions) (flutter/flutter#172255) 2025-07-16 [email protected] Sync `CHANGELOG.md` (3.32.7) to `master` branch (flutter/flutter#172253) 2025-07-16 [email protected] Properly lay out and position RenderWebImage (flutter/flutter#171916) 2025-07-16 [email protected] Remove dead link in the doc index. (flutter/flutter#172240) 2025-07-16 [email protected] Roll Dart SDK from 766ee8029b11 to d71df90177e4 (1 revision) (flutter/flutter#172243) 2025-07-16 [email protected] Fix use of `Join-Path` in `last_engine_commit.ps1`(poweshell) (flutter/flutter#172242) 2025-07-16 [email protected] Marks Linux_pixel_7pro integration_ui_driver to be unflaky (flutter/flutter#172213) 2025-07-16 [email protected] [skwasm] Decrease reliance on finalizers/GC (flutter/flutter#172187) 2025-07-16 [email protected] Use `release-*.version` to simplify `last_engine_commit.sh` (no branch operations) (flutter/flutter#172236) 2025-07-16 [email protected] Roll Skia from 59be8479c637 to bf3f9b77d3a8 (7 revisions) (flutter/flutter#172233) 2025-07-16 [email protected] [web] Remove all usages of js_util. (flutter/flutter#171871) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…tter#189476) glBlitFramebuffer is a GLES3 / OpenGL 3.0 function and is not guaranteed to be present, so the Linux embedder should treat it as optional. The compositor was calling it unconditionally to blit the first layer, which breaks on OpenGL 2.0 drivers without the GL_EXT_framebuffer_blit extension and on drivers with a broken implementation (NVIDIA, Vivante, ARM per flutter#152099). Restore the blit-availability detection (GL version >= 3.0 or the GL_EXT_framebuffer_blit extension, plus the driver blacklist) and fall back to shader-based compositing for the first layer when blit is unavailable. This regressed in e983e59 ("Perform OpenGL compositing in the Flutter thread and write to a framebuffer." flutter#172090), which consolidated compositing and dropped the has_gl_framebuffer_blit check. Strengthen the NoBlitFramebuffer and BlitFramebufferNvidia tests to assert glBlitFramebuffer is never called. Fixes flutter#189322
This framebuffer then gets copied into GTK during the draw calls. This disconnects the Flutter rendering from the GTK rendering which will allow us to render Flutter using EGL directly and support rendering without any views present (required for multi-window).
Framebuffers are shared between the Flutter and GTK OpenGL contexts using EGLImage. When running under X11 GTK uses GLX and this is not possible - instead the buffers are copied via the CPU in this case.