Skip to content

iOS: Hardcode rendering API to Metal in tests (no-op) - #190422

Merged
cbracken merged 1 commit into
flutter:masterfrom
cbracken:sw-backend-hardcode-metal
Aug 3, 2026
Merged

iOS: Hardcode rendering API to Metal in tests (no-op)#190422
cbracken merged 1 commit into
flutter:masterfrom
cbracken:sw-backend-hardcode-metal

Conversation

@cbracken

@cbracken cbracken commented Aug 3, 2026

Copy link
Copy Markdown
Member

Some of our tests were selecting a rendering API between kMetal and kSoftware. On iOS we no longer support any backend other than Metal.

enable_impeller is a static constexpr const bool that's hardcoded to true, so these expressions always evaluate to kMetal; the kSoftware arm is dead code. This replaces the ternaries with kMetal to clean up the code and save the compiler a few microseconds.

This removes the last references to IOSRenderingAPI::kSoftware outside the no-Metal fallback itself. I'll send a follow-up to delete that.

No changes to behaviour, and really no change to the compiled tests for that matter.

Issue: #190041
Issue: #112232

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.

Some of our tests were selecting a rendering API between kMetal and
kSoftware. On iOS we no longer support any backend other than Metal.

`enable_impeller` is a `static constexpr const bool` that's hardcoded to
`true`, so these expressions always evaluate to `kMetal`; the
`kSoftware` arm is dead code. This replaces the ternaries with `kMetal`
to clean up the code and save the compiler a few microseconds.

This removes the last references to `IOSRenderingAPI::kSoftware` outside
the no-Metal fallback itself. I'll send a follow-up to delete that.

No changes to behaviour, and really no change to the compiled tests for
that matter.
@cbracken
cbracken requested a review from a team as a code owner August 3, 2026 01:56
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 3, 2026
@github-actions github-actions Bot added a: text input Entering text in a text field or keyboard related problems platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) team-ios Owned by iOS platform team labels Aug 3, 2026
@cbracken
cbracken requested review from gaaclarke and removed request for a team August 3, 2026 01:57

@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 several test files for the iOS platform view and accessibility bridge by hardcoding the rendering_api parameter to flutter::IOSRenderingAPI::kMetal during the instantiation of flutter::PlatformViewIOS, removing the previous conditional check based on the enable_impeller setting. There are no review comments, and I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: text input Entering text in a text field or keyboard related problems CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants