[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.
This commit is contained in:
parent
ee4208fd26
commit
60c1f37609
@ -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.
|
||||
|
@ -47,9 +47,6 @@ class MacOSDevice extends DesktopDevice {
|
||||
@override
|
||||
String get name => 'macOS';
|
||||
|
||||
@override
|
||||
bool get supportsImpeller => true;
|
||||
|
||||
@override
|
||||
Future<TargetPlatform> get targetPlatform async => TargetPlatform.darwin;
|
||||
|
||||
|
@ -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(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>['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(<FakeCommand>[
|
||||
const FakeCommand(
|
||||
command: <String>['debug'],
|
||||
exitCode: -1,
|
||||
environment: <String, String>{
|
||||
'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: <String>[],
|
||||
),
|
||||
);
|
||||
@ -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';
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user