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

Commit 098ec48

Browse files
authored
[Impeller] Fail loudly if --enable-software-rendering is used. (#44346)
We have tests today that are trying to testwith impeller but using software rendering, so they're not actually testing with impeller. In an unrelated patch, I'm causing the request to enable impeller to have additional checks that Impeller related objects/configurations are set when using Impeller, which isn't true if software rendering is enabled, and is causing the tests getting disabled here to fail. The tests are not actually testing Impeller and thus are getting added to the skip list (they now crash with this change). flutter/flutter#131888 tracks re-enabling them. They will almost certainly need different golden files than the Skia ones. Fixes flutter/flutter#131887
1 parent 7abb060 commit 098ec48

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

shell/common/shell.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ Shell::Shell(DartVMRef vm,
419419
volatile_path_tracker_(std::move(volatile_path_tracker)),
420420
weak_factory_gpu_(nullptr),
421421
weak_factory_(this) {
422+
FML_CHECK(!settings.enable_software_rendering || !settings.enable_impeller)
423+
<< "Software rendering is incompatible with Impeller.";
422424
FML_CHECK(vm_) << "Must have access to VM to create a shell.";
423425
FML_DCHECK(task_runners_.IsValid());
424426
FML_DCHECK(task_runners_.GetPlatformTaskRunner()->RunsTasksOnCurrentThread());

shell/common/shell_unittests.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4342,6 +4342,24 @@ TEST_F(ShellTest, PrintsErrorWhenPlatformMessageSentFromWrongThread) {
43424342
ASSERT_FALSE(DartVMRef::IsInstanceRunning());
43434343
}
43444344

4345+
TEST_F(ShellTest, DiesIfSoftwareRenderingAndImpellerAreEnabledDeathTest) {
4346+
#if defined(OS_FUCHSIA)
4347+
GTEST_SKIP() << "Fuchsia";
4348+
#endif // OS_FUCHSIA
4349+
::testing::FLAGS_gtest_death_test_style = "threadsafe";
4350+
Settings settings = CreateSettingsForFixture();
4351+
settings.enable_impeller = true;
4352+
settings.enable_software_rendering = true;
4353+
ThreadHost thread_host("io.flutter.test." + GetCurrentTestName() + ".",
4354+
ThreadHost::Type::Platform);
4355+
auto task_runner = thread_host.platform_thread->GetTaskRunner();
4356+
TaskRunners task_runners("test", task_runner, task_runner, task_runner,
4357+
task_runner);
4358+
EXPECT_DEATH_IF_SUPPORTED(
4359+
CreateShell(settings, task_runners),
4360+
"Software rendering is incompatible with Impeller.");
4361+
}
4362+
43454363
} // namespace testing
43464364
} // namespace flutter
43474365

testing/scenario_app/run_ios_tests.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,14 @@ echo "Running simulator tests with Impeller"
7878
echo ""
7979

8080
# Skip testFontRenderingWhenSuppliedWithBogusFont: https://github.com/flutter/flutter/issues/113250
81+
# Skip golden tests that use software rendering: https://github.com/flutter/flutter/issues/131888
8182
if set -o pipefail && xcodebuild -sdk iphonesimulator \
8283
-scheme Scenarios \
8384
-resultBundlePath "$RESULT_BUNDLE_PATH/ios_scenario.xcresult" \
8485
-destination 'platform=iOS Simulator,OS=16.2,name=iPhone SE (3rd generation)' \
8586
clean test \
8687
FLUTTER_ENGINE="$FLUTTER_ENGINE" \
87-
-skip-testing "ScenariosUITests/BogusFontTextTest/testFontRenderingWhenSuppliedWithBogusFont" \
88+
-skip-testing "ScenariosUITests/BogusFontTextTest/testFontRenderingWhenSuppliedWithBogusFont,ScenarioUITests/PlatformViewMutationLargeClipRRectWithTransformTests/testPlatformView,ScenarioUITests/MultiplePlatformViewsTest/testPlatformView,ScenarioUITests/PlatformViewWithOtherBackdropFilterTests/testPlatformView,ScenarioUITests/TwoPlatformViewsWithOtherBackDropFilterTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipPathTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipRectWithTransformTests/testPlatformView,ScenarioUITests/PlatformViewGestureRecognizerTests/testRejectPolicyUtilTouchesEnded,ScenarioUITests/NonFullScreenFlutterViewPlatformViewUITests/testPlatformView,ScenarioUITests/PlatformViewUITests/testPlatformView,ScenarioUITests/PlatformViewMutationClipRectAfterMovedTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipRectTests/testPlatformView,ScenarioUITests/TwoPlatformViewClipPathTests/testPlatformView,ScenarioUITests/MultiplePlatformViewsBackgroundForegroundTest/testPlatformView,ScenarioUITests/PlatformViewMutationOpacityTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipRRectTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipRRectWithTransformTests/testPlatformView,ScenarioUITests/PlatformViewMutationClipPathWithTransformTests/testPlatformView,ScenarioUITests/SpawnEngineTest/testSpawnEngineWorks,ScenarioUITests/PlatformViewRotation/testPlatformView,ScenarioUITests/TwoPlatformViewClipRRectTests/testPlatformView,ScenarioUITests/TwoPlatformViewClipRectTests/testPlatformView,ScenarioUITests/RenderingSelectionTest/testSoftwareRendering,ScenarioUITests/UnobstructedPlatformViewTests/testMultiplePlatformViewsWithOverlays,ScenarioUITests/UnobstructedPlatformViewTests/testNoOverlay,ScenarioUITests/PlatformViewMutationTransformTests/testPlatformView,ScenarioUITests/PlatformViewMutationLargeClipRRectTests/testPlatformView,ScenarioUITests/PlatformViewWithNegativeOtherBackDropFilterTests/testPlatformView" \
8889
INFOPLIST_FILE="Scenarios/Info_Impeller.plist"; then # Plist with FLTEnableImpeller=YES
8990
echo "test success."
9091
else

0 commit comments

Comments
 (0)