Skip to content

adds linux impeller project flag#186982

Merged
auto-submit[bot] merged 6 commits into
flutter:masterfrom
gaaclarke:linux-impeller-flag
Jun 3, 2026
Merged

adds linux impeller project flag#186982
auto-submit[bot] merged 6 commits into
flutter:masterfrom
gaaclarke:linux-impeller-flag

Conversation

@gaaclarke
Copy link
Copy Markdown
Member

fixes #186707

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 22, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically a: desktop Running on desktop team-linux Owned by the Linux platform team labels May 22, 2026
@gaaclarke gaaclarke changed the title Linux impeller flag adds linux impeller flag May 22, 2026
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. and removed CICD Run CI/CD labels May 22, 2026
@gaaclarke gaaclarke force-pushed the linux-impeller-flag branch from be0cd5b to 5506fcc Compare May 26, 2026 15:39
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label May 26, 2026
@gaaclarke gaaclarke changed the title adds linux impeller flag adds linux impeller project flag May 26, 2026
@gaaclarke gaaclarke marked this pull request as ready for review May 26, 2026 16:14
@gaaclarke gaaclarke requested a review from a team as a code owner May 26, 2026 16:14
@gaaclarke gaaclarke requested a review from loic-sharma May 26, 2026 16:14
Copy link
Copy Markdown
Contributor

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

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 introduces support for enabling the Impeller rendering backend on Linux via the project configuration (FlDartProject) and updates the engine to respect this setting alongside command-line switches. It also updates DesktopDevice to avoid forcing --enable-impeller=false when the status is set to platformDefault. The review feedback suggests optimizing the integration test cleanup by restoring the modified file in memory rather than spawning a git checkout process, and recommends using standard C++ bool types instead of GLib's gboolean for local variables in the engine code.

Comment on lines +19 to +20
final String myApplicationPath = path.join(appDir.path, 'linux', 'runner', 'my_application.cc');
final myApplicationFile = File(myApplicationPath);
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

Declare a variable to store the original content of my_application.cc so we can restore it in the finally block without spawning a git checkout process.

Suggested change
final String myApplicationPath = path.join(appDir.path, 'linux', 'runner', 'my_application.cc');
final myApplicationFile = File(myApplicationPath);
final String myApplicationPath = path.join(appDir.path, 'linux', 'runner', 'my_application.cc');
final myApplicationFile = File(myApplicationPath);
String? originalContent;

Comment on lines +82 to +83
final String originalContent = myApplicationFile.readAsStringSync();
final String modifiedContent = originalContent.replaceFirst(
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

Assign the read content to the originalContent variable so it can be restored in the finally block.

Suggested change
final String originalContent = myApplicationFile.readAsStringSync();
final String modifiedContent = originalContent.replaceFirst(
originalContent = myApplicationFile.readAsStringSync();
final String modifiedContent = originalContent!.replaceFirst(

Comment on lines +135 to 139
} finally {
if (myApplicationFile.existsSync()) {
await exec('git', <String>['checkout', myApplicationPath]);
}
}
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

Restore the original content of my_application.cc directly using writeAsStringSync instead of spawning a git checkout process. This is faster, safer, and avoids external process overhead.

Suggested change
} finally {
if (myApplicationFile.existsSync()) {
await exec('git', <String>['checkout', myApplicationPath]);
}
}
} finally {
if (originalContent != null) {
myApplicationFile.writeAsStringSync(originalContent!);
}
}

Comment on lines +815 to +826
gboolean enable_impeller = fl_dart_project_get_enable_impeller(self->project);
gboolean has_enable_impeller = FALSE;
for (const auto& env_switch : flutter::GetSwitchesFromEnvironment()) {
if (env_switch == "--enable-impeller" ||
env_switch == "--enable-impeller=true") {
enable_impeller = TRUE;
has_enable_impeller = TRUE;
} else if (env_switch == "--enable-impeller=false") {
enable_impeller = FALSE;
has_enable_impeller = TRUE;
}
}
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

Use standard C++ bool and true/false literals instead of GLib's gboolean and TRUE/FALSE macros for local variables. This aligns with standard C++ practices and the Google C++ Style Guide.

  bool enable_impeller = fl_dart_project_get_enable_impeller(self->project);
  bool has_enable_impeller = false;
  for (const auto& env_switch : flutter::GetSwitchesFromEnvironment()) {
    if (env_switch == "--enable-impeller" ||
        env_switch == "--enable-impeller=true") {
      enable_impeller = true;
      has_enable_impeller = true;
    } else if (env_switch == "--enable-impeller=false") {
      enable_impeller = false;
      has_enable_impeller = true;
    }
  }
References
  1. C++ code should follow the Google C++ Style Guide, which prefers standard C++ types (like bool) over platform-specific typedefs (like gboolean) for local variables. (link)

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 seems like a reasonable suggestion, but I'd defer to @robert-ancell here

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.

This code is using gboolean so it's correct to use TRUE/FALSE instead (this is done elsewhere).

@gaaclarke gaaclarke requested a review from robert-ancell May 28, 2026 20:39
@github-actions github-actions Bot removed the CICD Run CI/CD label May 29, 2026
@gaaclarke
Copy link
Copy Markdown
Member Author

@loic-sharma friendly ping

Copy link
Copy Markdown
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'd consider getting a review from @robert-ancell too

Copy link
Copy Markdown
Contributor

@robert-ancell robert-ancell left a comment

Choose a reason for hiding this comment

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

LGTM

@gaaclarke gaaclarke added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Jun 3, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 3, 2026
Merged via the queue into flutter:master with commit dcae056 Jun 3, 2026
210 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 3, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jun 5, 2026
Roll Flutter from 2ba5420a7049 to 1bdf4af29076 (43 revisions)

flutter/flutter@2ba5420...1bdf4af

2026-06-05 engine-flutter-autoroll@skia.org Roll Packages from 03352b5 to 61bdbb4 (5 revisions) (flutter/flutter#187612)
2026-06-05 engine-flutter-autoroll@skia.org Roll Skia from 6e003d7f69c8 to a47a9a2c8ae5 (1 revision) (flutter/flutter#187610)
2026-06-05 engine-flutter-autoroll@skia.org Roll Dart SDK from aad8be4ce307 to 6a9a0efe66eb (10 revisions) (flutter/flutter#187609)
2026-06-05 engine-flutter-autoroll@skia.org Roll Skia from 494f1bf55f51 to 6e003d7f69c8 (2 revisions) (flutter/flutter#187607)
2026-06-05 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from ZE1Jy9CtVVi-tjBAE... to N_LiSaBSUsE2LDZgG... (flutter/flutter#187597)
2026-06-05 engine-flutter-autoroll@skia.org Roll Skia from 59556fdb8c33 to 494f1bf55f51 (2 revisions) (flutter/flutter#187596)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 8eb107046fd5 to 59556fdb8c33 (1 revision) (flutter/flutter#187590)
2026-06-04 34871572+gmackall@users.noreply.github.com Remove `embedded_android_views_integration_test.dart` (flutter/flutter#187465)
2026-06-04 burak.karahan@mail.ru Remove Material imports from rendering editable tests (flutter/flutter#186951)
2026-06-04 jason-simmons@users.noreply.github.com [Impeller] Wait for the Vulkan device to become idle before destroying Vulkan objects in the AHBSwapchainImplVK destructor (flutter/flutter#187477)
2026-06-04 chris@bracken.jp [iOS] Eliminate unnecessary redeclaration of FlutterDisplayLink (flutter/flutter#187557)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187583)
2026-06-04 34871572+gmackall@users.noreply.github.com Log stdout in adb.dart (flutter/flutter#187531)
2026-06-04 mvincentong@gmail.com Clarify RouterDelegate popRoute bubbling (flutter/flutter#186875)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 928ded2a31af to 8eb107046fd5 (1 revision) (flutter/flutter#187584)
2026-06-04 1063596+reidbaker@users.noreply.github.com Add updating-android-sdk agent skill for rolling Android SDK in CIPD (flutter/flutter#187576)
2026-06-04 Rusino@users.noreply.github.com Fixing alignment issue (flutter/flutter#187518)
2026-06-04 brackenavaron@gmail.com [Material Cross Imports] Clean up Material Divider usages (flutter/flutter#187300)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from cecc0e0da9ae to 928ded2a31af (6 revisions) (flutter/flutter#187574)
2026-06-04 31859944+LongCatIsLooong@users.noreply.github.com Use swift demangle to verify internal Swift symbols (flutter/flutter#186835)
2026-06-04 1063596+reidbaker@users.noreply.github.com Add android 37 platform and build tools to script for android cipd bundle creation (flutter/flutter#187571)
2026-06-04 jason-simmons@users.noreply.github.com [Impeller] Increase the precision of the IPSampleWithTileModeOES coords parameter to match the input coordinates in the tiled_texture_fill_external shader (flutter/flutter#187545)
2026-06-04 engine-flutter-autoroll@skia.org Roll Packages from b11504f to 03352b5 (4 revisions) (flutter/flutter#187569)
2026-06-04 iinozemtsev@google.com Roll Dart SDK to Dart 3.13 beta2 (flutter/flutter#187555)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 611e3f8ceb93 to cecc0e0da9ae (1 revision) (flutter/flutter#187562)
2026-06-04 6655696+guidezpl@users.noreply.github.com Add step to bootstrap Flutter tool in coverage workflow (flutter/flutter#187199)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 4fdb859c8da7 to 611e3f8ceb93 (4 revisions) (flutter/flutter#187554)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from 0020aae33f63 to 4fdb859c8da7 (2 revisions) (flutter/flutter#187552)
2026-06-04 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from ap7MhLX4TdpWRrLS_... to ZE1Jy9CtVVi-tjBAE... (flutter/flutter#187550)
2026-06-04 stuartmorgan@google.com Add vector_math to package issue template (flutter/flutter#187536)
2026-06-04 jason-simmons@users.noreply.github.com Manual roll Dart SDK from d39850bf4a01 to 3b70b98fa7c0 (flutter/flutter#187519)
2026-06-04 engine-flutter-autoroll@skia.org Roll Skia from d625048c853a to 0020aae33f63 (20 revisions) (flutter/flutter#187539)
2026-06-04 smille2003@yandex.ru [Impeller][Windows] fix black screen on OpenGL fallback (flutter/flutter#187288)
2026-06-04 97480502+b-luk@users.noreply.github.com Fix unintentionally joined path contours (flutter/flutter#187522)
2026-06-03 matt.boetger@gmail.com fix: resolve issue #177379 by using lazy buildDirectory.dir() API in build.gradle template (flutter/flutter#187127)
2026-06-03 34871572+gmackall@users.noreply.github.com Add a skill for flake analysis (flutter/flutter#187530)
2026-06-03 30870216+gaaclarke@users.noreply.github.com adds linux impeller project flag (flutter/flutter#186982)
2026-06-03 codedoctor@linwood.dev Add support for stylus buttons (flutter/flutter#183369)
2026-06-03 46920873+gabrimatic@users.noreply.github.com Prevent Cubic transform from looping on out-of-range input (flutter/flutter#185875)
2026-06-03 bdero@google.com [Impeller] Reland: Allow attaching specific texture mip levels and slices (flutter/flutter#187470)
2026-06-03 kjlubick@users.noreply.github.com [skia] Update image deserial proc (flutter/flutter#185041)
2026-06-03 112751483+shivanshu877@users.noreply.github.com docs: update Impeller advanced blend docs for framebuffer fetch (flutter/flutter#185457)
2026-06-03 ahmedsameha1@gmail.com Handle#6537 fifth grouped tests (flutter/flutter#183720)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-linux Building on or for Linux specifically team-linux Owned by the Linux platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[linux] Add runtime switch to enable Impeller

3 participants