[flutter_tools] remove raster stats CLI option. (#152501)
The raster stats feature is being removed from devtools and the engine. Remove the CLI option as well. Fixes https://github.com/flutter/flutter/issues/144191 Fixes https://github.com/flutter/flutter/issues/132169
This commit is contained in:
@@ -124,11 +124,6 @@ class CommandHelp {
|
||||
'WidgetsApp.showWidgetInspectorOverride',
|
||||
);
|
||||
|
||||
late final CommandHelpOption j = _makeOption(
|
||||
'j',
|
||||
'Dump frame raster stats for the current frame. (Unsupported for web)',
|
||||
);
|
||||
|
||||
late final CommandHelpOption k = _makeOption(
|
||||
'k',
|
||||
'Toggle CanvasKit rendering.',
|
||||
|
||||
@@ -694,52 +694,6 @@ abstract class ResidentHandlers {
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Dump frame rasterization metrics for the last rendered frame.
|
||||
///
|
||||
/// The last frames gets re-painted while recording additional tracing info
|
||||
/// pertaining to the various draw calls issued by the frame. The timings
|
||||
/// recorded here are not indicative of production performance. The intended
|
||||
/// use case is to look at the various layers in proportion to see what
|
||||
/// contributes the most towards raster performance.
|
||||
Future<bool> debugFrameJankMetrics() async {
|
||||
if (!supportsServiceProtocol) {
|
||||
return false;
|
||||
}
|
||||
for (final FlutterDevice? device in flutterDevices) {
|
||||
if (device?.targetPlatform == TargetPlatform.web_javascript) {
|
||||
logger.printWarning('Unable to get jank metrics for web');
|
||||
continue;
|
||||
}
|
||||
final List<FlutterView> views = await device!.vmService!.getFlutterViews();
|
||||
try {
|
||||
for (final FlutterView view in views) {
|
||||
final Map<String, Object?>? rasterData =
|
||||
await device.vmService!.renderFrameWithRasterStats(
|
||||
viewId: view.id,
|
||||
uiIsolateId: view.uiIsolate!.id,
|
||||
);
|
||||
if (rasterData != null) {
|
||||
final File tempFile = globals.fsUtils.getUniqueFile(
|
||||
globals.fs.currentDirectory,
|
||||
'flutter_jank_metrics',
|
||||
'json',
|
||||
);
|
||||
tempFile.writeAsStringSync(jsonEncode(rasterData), flush: true);
|
||||
logger.printStatus('Wrote jank metrics to ${tempFile.absolute.path}');
|
||||
} else {
|
||||
logger.printWarning('Unable to get jank metrics.');
|
||||
}
|
||||
}
|
||||
} on vm_service.RPCError catch (err) {
|
||||
if (err.code != RPCErrorCodes.kServerError || !err.message.contains('Raster status not supported on Impeller backend')) {
|
||||
rethrow;
|
||||
}
|
||||
logger.printWarning('Unable to get jank metrics for Impeller renderer');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// Dump the application's current layer tree to the terminal.
|
||||
Future<bool> debugDumpLayerTree() async {
|
||||
if (!supportsServiceProtocol || !isRunningDebug) {
|
||||
@@ -1558,7 +1512,6 @@ abstract class ResidentRunner extends ResidentHandlers {
|
||||
if (isRunningDebug) {
|
||||
commandHelp.g.print();
|
||||
}
|
||||
commandHelp.j.print();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1739,9 +1692,6 @@ class TerminalHandler {
|
||||
return residentRunner.debugToggleWidgetInspector();
|
||||
case 'I':
|
||||
return residentRunner.debugToggleInvertOversizedImages();
|
||||
case 'j':
|
||||
case 'J':
|
||||
return residentRunner.debugFrameJankMetrics();
|
||||
case 'L':
|
||||
return residentRunner.debugDumpLayerTree();
|
||||
case 'o':
|
||||
|
||||
@@ -28,7 +28,6 @@ const String kFlushUIThreadTasksMethod = '_flutter.flushUIThreadTasks';
|
||||
const String kRunInViewMethod = '_flutter.runInView';
|
||||
const String kListViewsMethod = '_flutter.listViews';
|
||||
const String kScreenshotSkpMethod = '_flutter.screenshotSkp';
|
||||
const String kRenderFrameWithRasterStatsMethod = '_flutter.renderFrameWithRasterStats';
|
||||
const String kReloadAssetFonts = '_flutter.reloadAssetFonts';
|
||||
|
||||
const String kFlutterToolAlias = 'Flutter Tools';
|
||||
@@ -593,26 +592,6 @@ class FlutterVmService {
|
||||
await onRunnable;
|
||||
}
|
||||
|
||||
/// Renders the last frame with additional raster tracing enabled.
|
||||
///
|
||||
/// When a frame is rendered using this method it will incur additional cost
|
||||
/// for rasterization which is not reflective of how long the frame takes in
|
||||
/// production. This is primarily intended to be used to identify the layers
|
||||
/// that result in the most raster perf degradation.
|
||||
Future<Map<String, Object?>?> renderFrameWithRasterStats({
|
||||
required String? viewId,
|
||||
required String? uiIsolateId,
|
||||
}) async {
|
||||
final vm_service.Response? response = await callMethodWrapper(
|
||||
kRenderFrameWithRasterStatsMethod,
|
||||
isolateId: uiIsolateId,
|
||||
args: <String, String?>{
|
||||
'viewId': viewId,
|
||||
},
|
||||
);
|
||||
return response?.json;
|
||||
}
|
||||
|
||||
Future<String> flutterDebugDumpApp({
|
||||
required String isolateId,
|
||||
}) async {
|
||||
|
||||
Reference in New Issue
Block a user