Add --trace-skia parameter to flutter run (#12070)

* Add --trace-skia parameter to flutter run

Skia tracing is extremely useful for internal debug, but reduces the
amount of space available in the Dart Timeline buffers.
Disable skia tracing by default and expose them via the --trace-skia
flag.

* Roll Engine to 57a1445a45964d386500c39f5e8d06db060abadb
This commit is contained in:
Carlo Bernaschina 2017-09-13 12:59:05 -07:00 committed by GitHub
parent 44ded0fe91
commit ba36008af6
5 changed files with 15 additions and 1 deletions

View File

@ -1 +1 @@
31d03de019794a4b0e3c98c04cf7be501fb962fb
57a1445a45964d386500c39f5e8d06db060abadb

View File

@ -404,6 +404,8 @@ class AndroidDevice extends Device {
cmd.addAll(<String>['--es', 'route', route]);
if (debuggingOptions.enableSoftwareRendering)
cmd.addAll(<String>['--ez', 'enable-software-rendering', 'true']);
if (debuggingOptions.traceSkia)
cmd.addAll(<String>['--ez', 'trace-skia', 'true']);
if (debuggingOptions.debuggingEnabled) {
if (debuggingOptions.buildInfo.isDebug)
cmd.addAll(<String>['--ez', 'enable-checked-mode', 'true']);

View File

@ -96,6 +96,11 @@ class RunCommand extends RunCommandBase {
'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('trace-skia',
defaultsTo: false,
negatable: false,
help: 'Enable tracing of Skia code. This is useful when debugging\n'
'the GPU thread. By default, Flutter will not log skia code.');
argParser.addFlag('use-test-fonts',
negatable: true,
defaultsTo: false,
@ -237,6 +242,7 @@ class RunCommand extends RunCommandBase {
startPaused: argResults['start-paused'],
useTestFonts: argResults['use-test-fonts'],
enableSoftwareRendering: argResults['enable-software-rendering'],
traceSkia: argResults['trace-skia'],
observatoryPort: observatoryPort,
diagnosticPort: diagnosticPort,
);

View File

@ -317,6 +317,7 @@ class DebuggingOptions {
DebuggingOptions.enabled(this.buildInfo, {
this.startPaused: false,
this.enableSoftwareRendering: false,
this.traceSkia: false,
this.useTestFonts: false,
this.observatoryPort,
this.diagnosticPort
@ -327,6 +328,7 @@ class DebuggingOptions {
useTestFonts = false,
startPaused = false,
enableSoftwareRendering = false,
traceSkia = false,
observatoryPort = null,
diagnosticPort = null;
@ -335,6 +337,7 @@ class DebuggingOptions {
final BuildInfo buildInfo;
final bool startPaused;
final bool enableSoftwareRendering;
final bool traceSkia;
final bool useTestFonts;
final int observatoryPort;
final int diagnosticPort;

View File

@ -214,6 +214,9 @@ class IOSDevice extends Device {
if (debuggingOptions.enableSoftwareRendering)
launchArguments.add('--enable-software-rendering');
if (debuggingOptions.traceSkia)
launchArguments.add('--trace-skia');
if (platformArgs['trace-startup'] ?? false)
launchArguments.add('--trace-startup');