diff --git a/packages/flutter_tools/lib/src/desktop_device.dart b/packages/flutter_tools/lib/src/desktop_device.dart index c8937258ddd..83271771d75 100644 --- a/packages/flutter_tools/lib/src/desktop_device.dart +++ b/packages/flutter_tools/lib/src/desktop_device.dart @@ -209,8 +209,6 @@ abstract class DesktopDevice extends Device { /// steps to be run. void onAttached(ApplicationPackage package, BuildInfo buildInfo, Process process) {} - bool get supportsImpeller => false; - /// Computes a set of environment variables used to pass debugging information /// to the engine without interfering with application level command line /// arguments. @@ -268,14 +266,12 @@ abstract class DesktopDevice extends Device { if (debuggingOptions.purgePersistentCache) { addFlag('purge-persistent-cache=true'); } - if (supportsImpeller) { - switch (debuggingOptions.enableImpeller) { - case ImpellerStatus.enabled: - addFlag('enable-impeller=true'); - case ImpellerStatus.disabled: - case ImpellerStatus.platformDefault: - addFlag('enable-impeller=false'); - } + switch (debuggingOptions.enableImpeller) { + case ImpellerStatus.enabled: + addFlag('enable-impeller=true'); + case ImpellerStatus.disabled: + case ImpellerStatus.platformDefault: + addFlag('enable-impeller=false'); } // Options only supported when there is a VM Service connection between the // tool and the device, usually in debug or profile mode. diff --git a/packages/flutter_tools/lib/src/macos/macos_device.dart b/packages/flutter_tools/lib/src/macos/macos_device.dart index 478c8ac27c1..43ada0af083 100644 --- a/packages/flutter_tools/lib/src/macos/macos_device.dart +++ b/packages/flutter_tools/lib/src/macos/macos_device.dart @@ -47,9 +47,6 @@ class MacOSDevice extends DesktopDevice { @override String get name => 'macOS'; - @override - bool get supportsImpeller => true; - @override Future get targetPlatform async => TargetPlatform.darwin; diff --git a/packages/flutter_tools/test/general.shard/desktop_device_test.dart b/packages/flutter_tools/test/general.shard/desktop_device_test.dart index 57631ac8fe7..39890473e67 100644 --- a/packages/flutter_tools/test/general.shard/desktop_device_test.dart +++ b/packages/flutter_tools/test/general.shard/desktop_device_test.dart @@ -155,14 +155,15 @@ void main() { 'FLUTTER_ENGINE_SWITCH_10': 'dump-skp-on-shader-compilation=true', 'FLUTTER_ENGINE_SWITCH_11': 'cache-sksl=true', 'FLUTTER_ENGINE_SWITCH_12': 'purge-persistent-cache=true', - 'FLUTTER_ENGINE_SWITCH_13': 'enable-checked-mode=true', - 'FLUTTER_ENGINE_SWITCH_14': 'verify-entry-points=true', - 'FLUTTER_ENGINE_SWITCH_15': 'start-paused=true', - 'FLUTTER_ENGINE_SWITCH_16': 'disable-service-auth-codes=true', - 'FLUTTER_ENGINE_SWITCH_17': 'dart-flags=--null_assertions', - 'FLUTTER_ENGINE_SWITCH_18': 'use-test-fonts=true', - 'FLUTTER_ENGINE_SWITCH_19': 'verbose-logging=true', - 'FLUTTER_ENGINE_SWITCHES': '19', + 'FLUTTER_ENGINE_SWITCH_13': 'enable-impeller=false', + 'FLUTTER_ENGINE_SWITCH_14': 'enable-checked-mode=true', + 'FLUTTER_ENGINE_SWITCH_15': 'verify-entry-points=true', + 'FLUTTER_ENGINE_SWITCH_16': 'start-paused=true', + 'FLUTTER_ENGINE_SWITCH_17': 'disable-service-auth-codes=true', + 'FLUTTER_ENGINE_SWITCH_18': 'dart-flags=--null_assertions', + 'FLUTTER_ENGINE_SWITCH_19': 'use-test-fonts=true', + 'FLUTTER_ENGINE_SWITCH_20': 'verbose-logging=true', + 'FLUTTER_ENGINE_SWITCHES': '20', } ), ]); @@ -209,7 +210,8 @@ void main() { 'FLUTTER_ENGINE_SWITCH_2': 'trace-startup=true', 'FLUTTER_ENGINE_SWITCH_3': 'trace-allowlist=foo,bar', 'FLUTTER_ENGINE_SWITCH_4': 'cache-sksl=true', - 'FLUTTER_ENGINE_SWITCHES': '4', + 'FLUTTER_ENGINE_SWITCH_5': 'enable-impeller=false', + 'FLUTTER_ENGINE_SWITCHES': '5', } ), ]); @@ -301,7 +303,7 @@ void main() { ); }); - testWithoutContext('Desktop devices that support impeller pass through the enable-impeller flag', () async { + testWithoutContext('Desktop devices pass through the enable-impeller flag', () async { final FakeProcessManager processManager = FakeProcessManager.list([ const FakeCommand( command: ['debug'], @@ -317,7 +319,6 @@ void main() { ]); final FakeDesktopDevice device = setUpDesktopDevice( processManager: processManager, - supportsImpeller: true, ); final FakeApplicationPackage package = FakeApplicationPackage(); @@ -332,16 +333,17 @@ void main() { ); }); - testWithoutContext('Desktop devices that do not support impeller ignore the enable-impeller flag', () async { + testWithoutContext('Desktop devices pass through the --no-enable-impeller flag', () async { final FakeProcessManager processManager = FakeProcessManager.list([ const FakeCommand( command: ['debug'], exitCode: -1, environment: { 'FLUTTER_ENGINE_SWITCH_1': 'enable-dart-profiling=true', - 'FLUTTER_ENGINE_SWITCH_2': 'enable-checked-mode=true', - 'FLUTTER_ENGINE_SWITCH_3': 'verify-entry-points=true', - 'FLUTTER_ENGINE_SWITCHES': '3' + 'FLUTTER_ENGINE_SWITCH_2': 'enable-impeller=false', + 'FLUTTER_ENGINE_SWITCH_3': 'enable-checked-mode=true', + 'FLUTTER_ENGINE_SWITCH_4': 'verify-entry-points=true', + 'FLUTTER_ENGINE_SWITCHES': '4' } ), ]); @@ -355,7 +357,7 @@ void main() { prebuiltApplication: true, debuggingOptions: DebuggingOptions.enabled( BuildInfo.debug, - enableImpeller: ImpellerStatus.enabled, + enableImpeller: ImpellerStatus.disabled, dartEntrypointArgs: [], ), ); @@ -368,7 +370,6 @@ FakeDesktopDevice setUpDesktopDevice({ ProcessManager? processManager, OperatingSystemUtils? operatingSystemUtils, bool nullExecutablePathForDevice = false, - bool supportsImpeller = false, }) { return FakeDesktopDevice( fileSystem: fileSystem ?? MemoryFileSystem.test(), @@ -376,7 +377,6 @@ FakeDesktopDevice setUpDesktopDevice({ processManager: processManager ?? FakeProcessManager.any(), operatingSystemUtils: operatingSystemUtils ?? FakeOperatingSystemUtils(), nullExecutablePathForDevice: nullExecutablePathForDevice, - supportsImpeller: supportsImpeller, ); } @@ -388,7 +388,6 @@ class FakeDesktopDevice extends DesktopDevice { required FileSystem fileSystem, required OperatingSystemUtils operatingSystemUtils, this.nullExecutablePathForDevice = false, - this.supportsImpeller = false, }) : super( 'dummy', platformType: PlatformType.linux, @@ -407,9 +406,6 @@ class FakeDesktopDevice extends DesktopDevice { final bool nullExecutablePathForDevice; - @override - final bool supportsImpeller; - @override String get name => 'dummy';