Skip to content

iOS: Eliminate use of IOSContextNoop in platform view tests - #190419

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

cbracken merged 1 commit into
flutter:masterfrom
cbracken:sw-backend-cleanup-context

Conversation

@cbracken

@cbracken cbracken commented Aug 3, 2026 •

Copy link
Copy Markdown
Member

FlutterPlatformViewsTest used the internal engine class flutter::IOSContextNoop in a dozen places purely as a no-op context to hand to submitFrame:withIosContext:. This replaces those with a local FakeIOSContext that replicates the behaviour the tests rely on so that we can delete IOSContextNoop in a follow-up.

Like IOSContextNoop FakeIOSContext reports the Impeller backend and returns no external texture, and inherits the null Impeller/Aiks contexts from the base class. The one place that uses the engine's real context (GetIosContext) is left untouched. I suspect we can eventually move this code to use the real Metal backend but for now, this is just refactoring with no semantic change.

Back in ancient times, before the simulator required Metal, and when iOS still had a Skia software renderer, we ran that on the Simulator due to some issues with our OpenGL implementation. Later, Flutter on iOS migrated from Skia to Impeller. Skia supports a software backend but Impeller did not, and so when running on Impeller, we stubbed out the software backend to no-op context/surfaces, hence IOSContextNoop and IOSSurfaceNoop. The Simulator now requires Metal and Flutter has eliminated Skia support altogether so there's no longer a software mode at all, nor a need for a no-op path in case you're using Impeller and ask for a software backend.

This is part of a series of changes to remove the dead no-op fallback.

No behavioural change; just a test refactoring.

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.

`FlutterPlatformViewsTest` used the internal engine class
`flutter::IOSContextNoop` in a dozen places purely as a no-op context to
hand to `submitFrame:withIosContext:`. This replaces those with a local
`FakeIOSContext` that replicates the behaviour the tests rely on so that
we can delete `IOSContextNoop` in a follow-up.

Like `IOSContextNoop` `FakeIOSContext` reports the Impeller backend and
returns no external texture, and inherits the null Impeller/Aiks
contexts from the base class. The one place that uses the engine's real
context (`GetIosContext`) is left untouched. I suspect we can eventually
move this code to use the real Metal backend but for now, this is just
refactoring with no semantic change.

Back in ancient times, before the simulator required Metal, and when iOS
still had a Skia software renderer, we ran that on the Simulator due to
some issues with our OpenGL implementation. Later, Flutter on iOS
migrated from Skia to Impeller. Skia supports a software backend but
Impeller did not, and so when running on Impeller, we stubbed out the
software backend to no-op context/surfaces, hence IOSContextNoop and
IOSSurfaceNoop. The Simulator now *requires* Metal and Flutter has
eliminated Skia support altogether so there's no longer a software mode
at all, nor a need for a no-op path in case you're using Impeller and
ask for a software backend.

This is part of a series of changes to remove the dead no-op fallback.

No behavioural change; just a test refactoring.

Issue: flutter#190041
@cbracken
cbracken requested a review from a team as a code owner August 3, 2026 00:32
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 3, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Aug 3, 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 replaces the use of flutter::IOSContextNoop with a newly defined FakeIOSContext within FlutterPlatformViewsTest.mm. The FakeIOSContext implements the flutter::IOSContext interface, returning kImpeller as the backend and nullptr for external textures. Multiple test cases have been updated to instantiate FakeIOSContext instead of IOSContextNoop. There are no review comments, and I have no feedback to provide.

@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.

lgtm!

@cbracken
cbracken added this pull request to the merge queue Aug 3, 2026
Merged via the queue into flutter:master with commit ca7bea9 Aug 3, 2026
21 of 22 checks passed
@cbracken
cbracken deleted the sw-backend-cleanup-context branch August 3, 2026 23:25
@cbracken

cbracken commented Aug 4, 2026 •

Copy link
Copy Markdown
Member Author

Reason for revert: This was fine as was the patch that removed GetBackend() but parallelising them was not.

Reverting then will sent out again but smaller this time.

@cbracken cbracken added the revert Autorevert PR (with "Reason for revert:" comment) label Aug 4, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #190501

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Aug 4, 2026
pull Bot pushed a commit to edisplay/flutter that referenced this pull request Aug 4, 2026
…lutter#190501)

Reverts: [iOS: Eliminate use of IOSContextNoop in platform view
tests](flutter#190419)

Initiated by: @cbracken

Reason for reverting: This was fine as was the patch that removed
GetBackend() but parallelising them was not.

Original PR Author: @cbracken

Reviewed By: @gaaclarke

The original PR description is provided below:

`FlutterPlatformViewsTest` used the internal engine class
`flutter::IOSContextNoop` in a dozen places purely as a no-op context to
hand to `submitFrame:withIosContext:`. This replaces those with a local
`FakeIOSContext` that replicates the behaviour the tests rely on so that
we can delete `IOSContextNoop` in a follow-up.

Like `IOSContextNoop` `FakeIOSContext` reports the Impeller backend and
returns no external texture, and inherits the null Impeller/Aiks
contexts from the base class. The one place that uses the engine's real
context (`GetIosContext`) is left untouched. I suspect we can eventually
move this code to use the real Metal backend but for now, this is just
refactoring with no semantic change.

Back in ancient times, before the simulator required Metal, and when iOS
still had a Skia software renderer, we ran that on the Simulator due to
some issues with our OpenGL implementation. Later, Flutter on iOS
migrated from Skia to Impeller. Skia supports a software backend but
Impeller did not, and so when running on Impeller, we stubbed out the
software backend to no-op context/surfaces, hence IOSContextNoop and
IOSSurfaceNoop. The Simulator now *requires* Metal and Flutter has
eliminated Skia support altogether so there's no longer a software mode
at all, nor a need for a no-op path in case you're using Impeller and
ask for a software backend.

This is part of a series of changes to remove the dead no-op fallback.

No behavioural change; just a test refactoring.

Issue: flutter#190041

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [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.

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](https://developers.google.com/gemini-code-assist/docs/review-github-code).
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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
harryterkelsen pushed a commit to mbcorona/flutter that referenced this pull request Aug 4, 2026
…lutter#190509)

This relands flutter#190419, which I reverted in flutter#190501 because it broke the
tree due to a (non-merge) conflict with flutter#190416.

flutter#190419 added a local `FakeIOSContext` whose `GetBackend()` override
returned `flutter::IOSRenderingBackend::kImpeller`.

flutter#190416 landed immediately before it and removed the
`IOSContext::GetBackend()` virtual and the `IOSRenderingBackend` enum,
so the two changes had no merge conflicts but `FakeIOSContext` no longer
compiled once both were in the tree.

This reland is identical other than deleting the `GetBackend()`
override. `FakeIOSContext` still inherits the null Impeller/Aiks
contexts from the base class and returns no external texture, matching
the behaviour the tests rely on.

Original change:

`FlutterPlatformViewsTest` used the internal engine class
`flutter::IOSContextNoop` in a dozen places purely as a no-op context to
hand to `submitFrame:withIosContext:`. This replaces those with a local
`FakeIOSContext` that replicates the behaviour the tests rely on so that
we can delete `IOSContextNoop` in a follow-up.

Back in ancient times, before the simulator required Metal, and when iOS
still had a Skia software renderer, we ran that on the Simulator due to
some issues with our OpenGL implementation. Later, Flutter on iOS
migrated from Skia to Impeller. Skia supports a software backend but
Impeller did not, and so when running on Impeller, we stubbed out the
software backend to no-op context/surfaces, hence IOSContextNoop and
IOSSurfaceNoop. The Simulator now *requires* Metal and Flutter has
eliminated Skia support altogether so there's no longer a software mode
at all, nor a need for a no-op path in case you're using Impeller and
ask for a software backend.

This is part of a series of changes to remove the dead no-op fallback.

No behavioural change; just a test refactoring.

Issue: flutter#190041

<!--
Thanks for filing a pull request!
Reviewers are typically assigned within a week of filing a request.
To learn more about code review, see our documentation on Tree Hygiene:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
-->

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [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.

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](https://developers.google.com/gemini-code-assist/docs/review-github-code).
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.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Aug 10, 2026
…12406)

Manual roll Flutter from e52f01c920ad to b766512c65d8 (42 revisions)

Manual roll requested by [email protected]

flutter/flutter@e52f01c...b766512

2026-08-04 [email protected] Roll Dart SDK from 2a799a2404e9 to 9859c0a39adb (4 revisions) (flutter/flutter#190521)
2026-08-04 [email protected] Revert: iOS: Eliminate use of IOSContextNoop in platform view tests (flutter/flutter#190501)
2026-08-04 [email protected] [Impeller] Enable ETC2/ASTC LDR/BC texture compression features at Vulkan device creation (flutter/flutter#189303)
2026-08-03 [email protected] Remove openglessdf from impeller_unittests. (flutter/flutter#190469)
2026-08-03 [email protected] [web] Unify image decoding and codecs on CanvasKit and Skwasm (flutter/flutter#188573)
2026-08-03 [email protected] iOS: Eliminate use of IOSContextNoop in platform view tests (flutter/flutter#190419)
2026-08-03 [email protected] Add path rendering benchmarks (flutter/flutter#188654)
2026-08-03 [email protected] Add windows platform support for primitive_shape_test integration test (flutter/flutter#190464)
2026-08-03 [email protected] Roll Skia from 958c1c1921a1 to a08d918ebd6a (3 revisions) (flutter/flutter#190467)
2026-08-03 [email protected] tests: add --ios-runtime param (flutter/flutter#190414)
2026-08-03 [email protected] iOS: Remove the synchronous first-frame wait (flutter/flutter#190432)
2026-08-03 [email protected] iOS: Eliminate the Impeller/Skia backend selection params (flutter/flutter#190416)
2026-08-03 [email protected] iOS,macOS: Use @autoclosure in Logger (flutter/flutter#190417)
2026-08-03 [email protected] tools: Support FLUTTER_HOST_ARCH in update_dart_sdk scripts (flutter/flutter#190421)
2026-08-03 [email protected] iOS: Hardcode rendering API to Metal in tests (no-op) (flutter/flutter#190422)
2026-08-03 [email protected] a11y: Map disabled/read-only semantics to AX node restriction (flutter/flutter#190353)
2026-08-03 [email protected] [Infra] Replace defunct umbrella template with Wasm issue form (flutter/flutter#190471)
2026-08-03 [email protected] Roll Skia from abecb0dc02c1 to 958c1c1921a1 (4 revisions) (flutter/flutter#190459)
2026-08-03 [email protected] Roll Dart SDK from 65b163be2485 to 2a799a2404e9 (3 revisions) (flutter/flutter#190454)
2026-08-03 [email protected] Roll Skia from 68efb3f2ad16 to abecb0dc02c1 (1 revision) (flutter/flutter#190443)
2026-08-03 [email protected] Roll Packages from 5351d8c to ac87e65 (4 revisions) (flutter/flutter#190441)
2026-08-03 [email protected] Roll Skia from 5a761eb826c1 to 68efb3f2ad16 (1 revision) (flutter/flutter#190440)
2026-08-03 [email protected] Roll Skia from 4c9f8b4805e2 to 5a761eb826c1 (1 revision) (flutter/flutter#190437)
2026-08-03 [email protected] [macOS] Resume app lifecycle on becomeActive to avoid frozen UI after occlusion (flutter/flutter#188772)
2026-08-03 [email protected] Roll Skia from 39cda9d6d7d2 to 4c9f8b4805e2 (6 revisions) (flutter/flutter#190426)
2026-08-03 [email protected] Roll Skia from df13bfb5a54e to 39cda9d6d7d2 (2 revisions) (flutter/flutter#190425)
2026-08-02 [email protected] iOS: Serialise CADisplayLink access in VSyncClient tests (flutter/flutter#190335)
2026-08-02 [email protected] Roll Skia from 32329e5643b5 to df13bfb5a54e (1 revision) (flutter/flutter#190394)
2026-08-02 [email protected] [Impeller] Skip binding dead-code-eliminated resources on Metal (flutter/flutter#190040)
2026-08-01 [email protected] [Flutter GPU] Raise Dart errors for invalid render pipelines and memoize per-draw pipeline state (flutter/flutter#189899)
2026-08-01 [email protected] Revert "Improve non rect platform view rendering  (#182662)" (flutter/flutter#190003)
2026-08-01 [email protected] Roll Skia from ebf50520d720 to 32329e5643b5 (1 revision) (flutter/flutter#190389)
2026-08-01 [email protected] Roll Skia from f73c4510d12d to ebf50520d720 (6 revisions) (flutter/flutter#190376)
2026-07-31 [email protected] Primitive shape integration test (flutter/flutter#190368)
2026-07-31 [email protected] Eliminate some early returns in uber_sdf.frag to fix broken UberSDF AA on Windows (flutter/flutter#190260)
2026-07-31 [email protected] chore: swiftshader mirrored + llvm16 (flutter/flutter#181225)
2026-07-31 [email protected] [web] Remove in-repo agent documentation (flutter/flutter#190326)
2026-07-31 [email protected] [windows]: Uses offscreen MSAA when implicit msaa isn't available. (flutter/flutter#190256)
2026-07-31 [email protected] flutter_tools: Use new FileSystemExtension from devtools (flutter/flutter#190360)
2026-07-31 [email protected] Roll Dart SDK from c3acfc2479f6 to 65b163be2485 (1 revision) (flutter/flutter#190358)
2026-07-31 [email protected] Use devicectl for screenshots on Xcode 27, remove idevicescreenshot artifact (flutter/flutter#189091)
2026-07-31 [email protected] Roll Skia from 7ef86a5b0eb9 to f73c4510d12d (1 revision) (flutter/flutter#190352)

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

Labels

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.

3 participants