Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 14ac66c

Browse files
dnfieldharryterkelsen
authored andcommitted
[Impeller] fail if software backend is chosen and Impeller is enabled on iOS (#46124)
Fixes flutter/flutter#127408 This is also related to #44346, which made it fatal to explicitly request both impeller and the software backend. Before landing this, we need to update some google internal tests that end up in this state to explicitly request Skia (or to get into a mode where they can actually use metal).
1 parent d340ef2 commit 14ac66c

4 files changed

Lines changed: 208 additions & 71 deletions

File tree

shell/platform/darwin/ios/framework/Source/FlutterEnginePlatformViewTest.mm

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ - (void)setUp {
7272
/*io=*/thread_task_runner);
7373
platform_view = std::make_unique<flutter::PlatformViewIOS>(
7474
/*delegate=*/fake_delegate,
75-
/*rendering_api=*/flutter::IOSRenderingAPI::kSoftware,
75+
/*rendering_api=*/fake_delegate.settings_.enable_impeller
76+
? flutter::IOSRenderingAPI::kMetal
77+
: flutter::IOSRenderingAPI::kSoftware,
7678
/*platform_views_controller=*/nil,
7779
/*task_runners=*/runners,
7880
/*worker_task_runner=*/nil,
@@ -90,8 +92,13 @@ - (void)tearDown {
9092
}
9193

9294
- (void)testMsaaSampleCount {
93-
// Default should be 1.
94-
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kNone);
95+
if (fake_delegate.settings_.enable_impeller) {
96+
// Default should be 4 for Impeller.
97+
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kFour);
98+
} else {
99+
// Default should be 1 for Skia.
100+
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kNone);
101+
}
95102

96103
// Verify the platform view creates a new context with updated msaa_samples.
97104
// Need to use Metal, since this is ignored for Software/GL.

0 commit comments

Comments
 (0)