Unverified Commit 60c1f376 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] remove desktop device restrictions on Impeller. (#130430)

All current desktop backends will support Impeller after https://github.com/flutter/engine/pull/43388 lands.
parent ee4208fd
...@@ -209,8 +209,6 @@ abstract class DesktopDevice extends Device { ...@@ -209,8 +209,6 @@ abstract class DesktopDevice extends Device {
/// steps to be run. /// steps to be run.
void onAttached(ApplicationPackage package, BuildInfo buildInfo, Process process) {} void onAttached(ApplicationPackage package, BuildInfo buildInfo, Process process) {}
bool get supportsImpeller => false;
/// Computes a set of environment variables used to pass debugging information /// Computes a set of environment variables used to pass debugging information
/// to the engine without interfering with application level command line /// to the engine without interfering with application level command line
/// arguments. /// arguments.
...@@ -268,14 +266,12 @@ abstract class DesktopDevice extends Device { ...@@ -268,14 +266,12 @@ abstract class DesktopDevice extends Device {
if (debuggingOptions.purgePersistentCache) { if (debuggingOptions.purgePersistentCache) {
addFlag('purge-persistent-cache=true'); addFlag('purge-persistent-cache=true');
} }
if (supportsImpeller) { switch (debuggingOptions.enableImpeller) {
switch (debuggingOptions.enableImpeller) { case ImpellerStatus.enabled:
case ImpellerStatus.enabled: addFlag('enable-impeller=true');
addFlag('enable-impeller=true'); case ImpellerStatus.disabled:
case ImpellerStatus.disabled: case ImpellerStatus.platformDefault:
case ImpellerStatus.platformDefault: addFlag('enable-impeller=false');
addFlag('enable-impeller=false');
}
} }
// Options only supported when there is a VM Service connection between the // Options only supported when there is a VM Service connection between the
// tool and the device, usually in debug or profile mode. // tool and the device, usually in debug or profile mode.
......
...@@ -47,9 +47,6 @@ class MacOSDevice extends DesktopDevice { ...@@ -47,9 +47,6 @@ class MacOSDevice extends DesktopDevice {
@override @override
String get name => 'macOS'; String get name => 'macOS';
@override
bool get supportsImpeller => true;
@override @override
Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin; Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin;
......
...@@ -155,14 +155,15 @@ void main() { ...@@ -155,14 +155,15 @@ void main() {
'FLUTTER_ENGINE_SWITCH_10': 'dump-skp-on-shader-compilation=true', 'FLUTTER_ENGINE_SWITCH_10': 'dump-skp-on-shader-compilation=true',
'FLUTTER_ENGINE_SWITCH_11': 'cache-sksl=true', 'FLUTTER_ENGINE_SWITCH_11': 'cache-sksl=true',
'FLUTTER_ENGINE_SWITCH_12': 'purge-persistent-cache=true', 'FLUTTER_ENGINE_SWITCH_12': 'purge-persistent-cache=true',
'FLUTTER_ENGINE_SWITCH_13': 'enable-checked-mode=true', 'FLUTTER_ENGINE_SWITCH_13': 'enable-impeller=false',
'FLUTTER_ENGINE_SWITCH_14': 'verify-entry-points=true', 'FLUTTER_ENGINE_SWITCH_14': 'enable-checked-mode=true',
'FLUTTER_ENGINE_SWITCH_15': 'start-paused=true', 'FLUTTER_ENGINE_SWITCH_15': 'verify-entry-points=true',
'FLUTTER_ENGINE_SWITCH_16': 'disable-service-auth-codes=true', 'FLUTTER_ENGINE_SWITCH_16': 'start-paused=true',
'FLUTTER_ENGINE_SWITCH_17': 'dart-flags=--null_assertions', 'FLUTTER_ENGINE_SWITCH_17': 'disable-service-auth-codes=true',
'FLUTTER_ENGINE_SWITCH_18': 'use-test-fonts=true', 'FLUTTER_ENGINE_SWITCH_18': 'dart-flags=--null_assertions',
'FLUTTER_ENGINE_SWITCH_19': 'verbose-logging=true', 'FLUTTER_ENGINE_SWITCH_19': 'use-test-fonts=true',
'FLUTTER_ENGINE_SWITCHES': '19', 'FLUTTER_ENGINE_SWITCH_20': 'verbose-logging=true',
'FLUTTER_ENGINE_SWITCHES': '20',
} }
), ),
]); ]);
...@@ -209,7 +210,8 @@ void main() { ...@@ -209,7 +210,8 @@ void main() {
'FLUTTER_ENGINE_SWITCH_2': 'trace-startup=true', 'FLUTTER_ENGINE_SWITCH_2': 'trace-startup=true',
'FLUTTER_ENGINE_SWITCH_3': 'trace-allowlist=foo,bar', 'FLUTTER_ENGINE_SWITCH_3': 'trace-allowlist=foo,bar',
'FLUTTER_ENGINE_SWITCH_4': 'cache-sksl=true', '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() { ...@@ -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(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>['debug'], command: <String>['debug'],
...@@ -317,7 +319,6 @@ void main() { ...@@ -317,7 +319,6 @@ void main() {
]); ]);
final FakeDesktopDevice device = setUpDesktopDevice( final FakeDesktopDevice device = setUpDesktopDevice(
processManager: processManager, processManager: processManager,
supportsImpeller: true,
); );
final FakeApplicationPackage package = FakeApplicationPackage(); final FakeApplicationPackage package = FakeApplicationPackage();
...@@ -332,16 +333,17 @@ void main() { ...@@ -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(<FakeCommand>[ final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
const FakeCommand( const FakeCommand(
command: <String>['debug'], command: <String>['debug'],
exitCode: -1, exitCode: -1,
environment: <String, String>{ environment: <String, String>{
'FLUTTER_ENGINE_SWITCH_1': 'enable-dart-profiling=true', 'FLUTTER_ENGINE_SWITCH_1': 'enable-dart-profiling=true',
'FLUTTER_ENGINE_SWITCH_2': 'enable-checked-mode=true', 'FLUTTER_ENGINE_SWITCH_2': 'enable-impeller=false',
'FLUTTER_ENGINE_SWITCH_3': 'verify-entry-points=true', 'FLUTTER_ENGINE_SWITCH_3': 'enable-checked-mode=true',
'FLUTTER_ENGINE_SWITCHES': '3' 'FLUTTER_ENGINE_SWITCH_4': 'verify-entry-points=true',
'FLUTTER_ENGINE_SWITCHES': '4'
} }
), ),
]); ]);
...@@ -355,7 +357,7 @@ void main() { ...@@ -355,7 +357,7 @@ void main() {
prebuiltApplication: true, prebuiltApplication: true,
debuggingOptions: DebuggingOptions.enabled( debuggingOptions: DebuggingOptions.enabled(
BuildInfo.debug, BuildInfo.debug,
enableImpeller: ImpellerStatus.enabled, enableImpeller: ImpellerStatus.disabled,
dartEntrypointArgs: <String>[], dartEntrypointArgs: <String>[],
), ),
); );
...@@ -368,7 +370,6 @@ FakeDesktopDevice setUpDesktopDevice({ ...@@ -368,7 +370,6 @@ FakeDesktopDevice setUpDesktopDevice({
ProcessManager? processManager, ProcessManager? processManager,
OperatingSystemUtils? operatingSystemUtils, OperatingSystemUtils? operatingSystemUtils,
bool nullExecutablePathForDevice = false, bool nullExecutablePathForDevice = false,
bool supportsImpeller = false,
}) { }) {
return FakeDesktopDevice( return FakeDesktopDevice(
fileSystem: fileSystem ?? MemoryFileSystem.test(), fileSystem: fileSystem ?? MemoryFileSystem.test(),
...@@ -376,7 +377,6 @@ FakeDesktopDevice setUpDesktopDevice({ ...@@ -376,7 +377,6 @@ FakeDesktopDevice setUpDesktopDevice({
processManager: processManager ?? FakeProcessManager.any(), processManager: processManager ?? FakeProcessManager.any(),
operatingSystemUtils: operatingSystemUtils ?? FakeOperatingSystemUtils(), operatingSystemUtils: operatingSystemUtils ?? FakeOperatingSystemUtils(),
nullExecutablePathForDevice: nullExecutablePathForDevice, nullExecutablePathForDevice: nullExecutablePathForDevice,
supportsImpeller: supportsImpeller,
); );
} }
...@@ -388,7 +388,6 @@ class FakeDesktopDevice extends DesktopDevice { ...@@ -388,7 +388,6 @@ class FakeDesktopDevice extends DesktopDevice {
required FileSystem fileSystem, required FileSystem fileSystem,
required OperatingSystemUtils operatingSystemUtils, required OperatingSystemUtils operatingSystemUtils,
this.nullExecutablePathForDevice = false, this.nullExecutablePathForDevice = false,
this.supportsImpeller = false,
}) : super( }) : super(
'dummy', 'dummy',
platformType: PlatformType.linux, platformType: PlatformType.linux,
...@@ -407,9 +406,6 @@ class FakeDesktopDevice extends DesktopDevice { ...@@ -407,9 +406,6 @@ class FakeDesktopDevice extends DesktopDevice {
final bool nullExecutablePathForDevice; final bool nullExecutablePathForDevice;
@override
final bool supportsImpeller;
@override @override
String get name => 'dummy'; String get name => 'dummy';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment