Skip to content

Commit

Permalink
[Impeller] fail if software backend is chosen and Impeller is enabled…
Browse files Browse the repository at this point in the history
… 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).
  • Loading branch information
dnfield authored and harryterkelsen committed Oct 23, 2023
1 parent d340ef2 commit 14ac66c
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ - (void)setUp {
/*io=*/thread_task_runner);
platform_view = std::make_unique<flutter::PlatformViewIOS>(
/*delegate=*/fake_delegate,
/*rendering_api=*/flutter::IOSRenderingAPI::kSoftware,
/*rendering_api=*/fake_delegate.settings_.enable_impeller
? flutter::IOSRenderingAPI::kMetal
: flutter::IOSRenderingAPI::kSoftware,
/*platform_views_controller=*/nil,
/*task_runners=*/runners,
/*worker_task_runner=*/nil,
Expand All @@ -90,8 +92,13 @@ - (void)tearDown {
}

- (void)testMsaaSampleCount {
// Default should be 1.
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kNone);
if (fake_delegate.settings_.enable_impeller) {
// Default should be 4 for Impeller.
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kFour);
} else {
// Default should be 1 for Skia.
XCTAssertEqual(platform_view->GetIosContext()->GetMsaaSampleCount(), MsaaSampleCount::kNone);
}

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

0 comments on commit 14ac66c

Please sign in to comment.