forked from firka/flutter
Add flags to pass '--enable-software-rendering' flag to engine in run command (#10449)
This commit is contained in:
@@ -397,6 +397,8 @@ class AndroidDevice extends Device {
|
||||
cmd.addAll(<String>['--ez', 'trace-startup', 'true']);
|
||||
if (route != null)
|
||||
cmd.addAll(<String>['--es', 'route', route]);
|
||||
if (debuggingOptions.enableSoftwareRendering)
|
||||
cmd.addAll(<String>['--ez', 'enable-software-rendering', 'true']);
|
||||
if (debuggingOptions.debuggingEnabled) {
|
||||
if (debuggingOptions.buildMode == BuildMode.debug)
|
||||
cmd.addAll(<String>['--ez', 'enable-checked-mode', 'true']);
|
||||
|
||||
@@ -88,6 +88,13 @@ class RunCommand extends RunCommandBase {
|
||||
defaultsTo: false,
|
||||
negatable: false,
|
||||
help: 'Start in a paused mode and wait for a debugger to connect.');
|
||||
argParser.addFlag('enable-software-rendering',
|
||||
defaultsTo: false,
|
||||
negatable: false,
|
||||
help: 'Enable rendering using the Skia software backend. This is useful\n'
|
||||
'when testing Flutter on emulators. By default, Flutter will\n'
|
||||
'attempt to either use OpenGL or Vulkan and fall back to software\n'
|
||||
'when neither is available.');
|
||||
argParser.addFlag('use-test-fonts',
|
||||
negatable: true,
|
||||
defaultsTo: false,
|
||||
@@ -218,6 +225,7 @@ class RunCommand extends RunCommandBase {
|
||||
getBuildMode(),
|
||||
startPaused: argResults['start-paused'],
|
||||
useTestFonts: argResults['use-test-fonts'],
|
||||
enableSoftwareRendering: argResults['enable-software-rendering'],
|
||||
observatoryPort: observatoryPort,
|
||||
diagnosticPort: diagnosticPort,
|
||||
);
|
||||
|
||||
@@ -299,6 +299,7 @@ abstract class Device {
|
||||
class DebuggingOptions {
|
||||
DebuggingOptions.enabled(this.buildMode, {
|
||||
this.startPaused: false,
|
||||
this.enableSoftwareRendering: false,
|
||||
this.useTestFonts: false,
|
||||
this.observatoryPort,
|
||||
this.diagnosticPort
|
||||
@@ -308,6 +309,7 @@ class DebuggingOptions {
|
||||
debuggingEnabled = false,
|
||||
useTestFonts = false,
|
||||
startPaused = false,
|
||||
enableSoftwareRendering = false,
|
||||
observatoryPort = null,
|
||||
diagnosticPort = null;
|
||||
|
||||
@@ -315,6 +317,7 @@ class DebuggingOptions {
|
||||
|
||||
final BuildMode buildMode;
|
||||
final bool startPaused;
|
||||
final bool enableSoftwareRendering;
|
||||
final bool useTestFonts;
|
||||
final int observatoryPort;
|
||||
final int diagnosticPort;
|
||||
|
||||
@@ -242,6 +242,9 @@ class IOSDevice extends Device {
|
||||
// the port picked and scrape that later.
|
||||
}
|
||||
|
||||
if (debuggingOptions.enableSoftwareRendering)
|
||||
launchArguments.add('--enable-software-rendering');
|
||||
|
||||
if (platformArgs['trace-startup'] ?? false)
|
||||
launchArguments.add('--trace-startup');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user