Skip to content

update GLFW to latest and use EGL context creation on linux#181259

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
planetmarshall:glfw-update
Jan 30, 2026
Merged

update GLFW to latest and use EGL context creation on linux#181259
auto-submit[bot] merged 2 commits into
flutter:masterfrom
planetmarshall:glfw-update

Conversation

@planetmarshall

Copy link
Copy Markdown
Contributor

Updates the GLFW dependency to master and uses the EGL context creation API on Linux. This allows Linux users to select an OpenGL implementation when running the impeller playground tests by defining __EGL_VENDOR_LIBRARY_FILENAMES.

For example, running

$ impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES

gives, in description_gles.cc ,

gl_version_string_ // OpenGL ES 3.2 NVIDIA 590.48.01

Then running

$ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
gl_version_string_ // OpenGL ES 3.2 Mesa 25.3.3-arch1.3

Fixes #181258

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Jan 21, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates GLFW and enables EGL context creation on Linux. The change adds a preprocessor block to set a GLFW window hint for Linux. My review includes one suggestion to refactor the platform-specific code for macOS and Linux to avoid code duplication and improve maintainability.

Comment on lines +82 to +86
#if FML_OS_LINUX
// Use EGL even on X11 then the client can select the GLES implementation
// by defining __EGL_VENDOR_LIBRARY_FILENAMES
::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This change introduces a duplicated call to ::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API). The same call exists in the #if FML_OS_MACOSX block on line 80.

To improve maintainability and adhere to the 'Don't Repeat Yourself' (DRY) principle, it would be better to combine these. You could use a single preprocessor block for both platforms:

#if FML_OS_MACOSX
  FML_CHECK(use_angle_) << "Must use Angle on macOS for OpenGL ES.";
#endif // FML_OS_MACOSX

#if FML_OS_MACOSX || FML_OS_LINUX
  // On macOS, EGL is used for ANGLE.
  // On Linux, EGL is used to allow the user to select the GLES implementation
  // by defining __EGL_VENDOR_LIBRARY_FILENAMES.
  ::glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
#endif

This would require moving the glfwWindowHint call from the FML_OS_MACOSX block into this new combined block.

References
  1. The style guide advises to 'Avoid duplicating state' and 'Write what you need and no more'. This change introduces code duplication which can be avoided for better maintainability. (link)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to make this change if requested by a human reviewer, but this is just duplicating the preprocessor condition instead of duplicating the code.

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good as long as CI is happy. I think the failures we saw are flakes (we have an ongoing flake we are trying to address). I kicked the bots for you.

@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jan 30, 2026
Merged via the queue into flutter:master with commit f94d0cb Jan 30, 2026
181 of 182 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jan 30, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Feb 2, 2026
flutter/flutter@1d9d6a9...9eafba4

2026-02-01 [email protected] Roll Skia from a8ceddc2bca0 to 4ee9eb659ae0 (1 revision) (flutter/flutter#181773)
2026-02-01 [email protected] Roll Skia from a5a535bc21a3 to a8ceddc2bca0 (1 revision) (flutter/flutter#181772)
2026-02-01 [email protected] Roll Dart SDK from cde322c518b9 to 84abc8d58ec8 (1 revision) (flutter/flutter#181767)
2026-02-01 [email protected] Roll Dart SDK from c72b3f527a07 to cde322c518b9 (1 revision) (flutter/flutter#181763)
2026-01-31 [email protected] Roll Dart SDK from 43de79f08887 to c72b3f527a07 (1 revision) (flutter/flutter#181762)
2026-01-31 [email protected] Roll Fuchsia Linux SDK from 27OsrsrKcrr2pOaqY... to nI52U4LJMrBv8G1M9... (flutter/flutter#181760)
2026-01-31 [email protected] Roll Dart SDK from a0aac59705e5 to 43de79f08887 (1 revision) (flutter/flutter#181758)
2026-01-31 [email protected] Roll Skia from b704afbcd8e7 to a5a535bc21a3 (1 revision) (flutter/flutter#181757)
2026-01-31 [email protected] Roll Dart SDK from d6f77f9098e1 to a0aac59705e5 (1 revision) (flutter/flutter#181756)
2026-01-31 [email protected] Roll Skia from 6f9511ce11ba to b704afbcd8e7 (4 revisions) (flutter/flutter#181753)
2026-01-31 [email protected] Roll Dart SDK from 0cf997832948 to d6f77f9098e1 (2 revisions) (flutter/flutter#181749)
2026-01-31 [email protected] Roll Skia from 33c00c0f3b8b to 6f9511ce11ba (1 revision) (flutter/flutter#181744)
2026-01-31 [email protected] Roll Dart SDK from be3ffc51d407 to 0cf997832948 (1 revision) (flutter/flutter#181740)
2026-01-30 [email protected] Roll Skia from b62d43b59dd6 to 33c00c0f3b8b (1 revision) (flutter/flutter#181735)
2026-01-30 [email protected] [Impeller] Fix type conversion warnings seen on Windows when Impeller GL API wrappers log arguments with function types (flutter/flutter#181734)
2026-01-30 [email protected] Update New Android API Docs (flutter/flutter#180604)
2026-01-30 [email protected] Roll Fuchsia Linux SDK from isy1ARvK-3bsvtfc-... to 27OsrsrKcrr2pOaqY... (flutter/flutter#181733)
2026-01-30 [email protected] Fix P3-to-sRGB color conversion to operate in linear light (flutter/flutter#181720)
2026-01-30 [email protected] chore: deflake Linux_mokey flutter_engine_group_performance (flutter/flutter#181624)
2026-01-30 [email protected] Roll Dart SDK from 2703fd9733ce to be3ffc51d407 (1 revision) (flutter/flutter#181729)
2026-01-30 [email protected] Ensure content-sizing resize is run on UI thread (flutter/flutter#181686)
2026-01-30 [email protected] [ Tool ] Cleanup `ResidentCompiler` initialization logic (flutter/flutter#181421)
2026-01-30 [email protected] [native assets] Split debug info into `.dsym` files (flutter/flutter#181533)
2026-01-30 [email protected] Roll Skia from 4745eb2fe837 to b62d43b59dd6 (1 revision) (flutter/flutter#181727)
2026-01-30 [email protected] add ccache support for custom toolchain (flutter/flutter#180737)
2026-01-30 [email protected] update GLFW to latest and use EGL context creation on linux (flutter/flutter#181259)
2026-01-30 [email protected] add stacktrace support when requested for host builds (flutter/flutter#181264)

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
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Feb 6, 2026
…181259)

Updates the GLFW dependency to master and uses the EGL context creation
API on Linux. This allows Linux users to select an OpenGL implementation
when running the impeller playground tests by defining
`__EGL_VENDOR_LIBRARY_FILENAMES`.

For example, running
```
$ impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```
gives,  in `description_gles.cc` ,
```
gl_version_string_ // OpenGL ES 3.2 NVIDIA 590.48.01
```

Then running

```
$ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```

```
gl_version_string_ // OpenGL ES 3.2 Mesa 25.3.3-arch1.3
```

Fixes flutter#181258

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
flutter-zl pushed a commit to flutter-zl/flutter that referenced this pull request Feb 10, 2026
…181259)

Updates the GLFW dependency to master and uses the EGL context creation
API on Linux. This allows Linux users to select an OpenGL implementation
when running the impeller playground tests by defining
`__EGL_VENDOR_LIBRARY_FILENAMES`.

For example, running
```
$ impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```
gives,  in `description_gles.cc` ,
```
gl_version_string_ // OpenGL ES 3.2 NVIDIA 590.48.01
```

Then running

```
$ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```

```
gl_version_string_ // OpenGL ES 3.2 Mesa 25.3.3-arch1.3
```

Fixes flutter#181258

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
rickhohler pushed a commit to rickhohler/flutter that referenced this pull request Feb 19, 2026
…181259)

Updates the GLFW dependency to master and uses the EGL context creation
API on Linux. This allows Linux users to select an OpenGL implementation
when running the impeller playground tests by defining
`__EGL_VENDOR_LIBRARY_FILENAMES`.

For example, running
```
$ impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```
gives,  in `description_gles.cc` ,
```
gl_version_string_ // OpenGL ES 3.2 NVIDIA 590.48.01
```

Then running

```
$ __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json impeller_unittests --gtest_filter=Play/AiksTest.ToImageFromImage/OpenGLES
```

```
gl_version_string_ // OpenGL ES 3.2 Mesa 25.3.3-arch1.3
```

Fixes flutter#181258

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GLFW test environment does not respect libglvnd configuration

3 participants