Rename GPU thread to raster thread in API docs (#53422)
This commit is contained in:
parent
5d63637e43
commit
1593788cd9
@ -34,9 +34,9 @@ Future<void> main() async {
|
|||||||
));
|
));
|
||||||
await SchedulerBinding.instance.endOfFrame;
|
await SchedulerBinding.instance.endOfFrame;
|
||||||
|
|
||||||
/// Wait 50ms to allow the GPU thread to actually put up the frame. (The
|
/// Wait 50ms to allow the raster thread to actually put up the frame. (The
|
||||||
/// endOfFrame future ends when we send the data to the engine, before the GPU
|
/// endOfFrame future ends when we send the data to the engine, before
|
||||||
/// thread has had a chance to rasterize, etc.)
|
/// the raster thread has had a chance to rasterize, etc.)
|
||||||
await Future<void>.delayed(const Duration(milliseconds: 50));
|
await Future<void>.delayed(const Duration(milliseconds: 50));
|
||||||
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
|
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_driver/driver_extension.dart';
|
import 'package:flutter_driver/driver_extension.dart';
|
||||||
|
|
||||||
/// This sample application creates a hard to render frame, causing the
|
/// This sample application creates a hard to render frame, causing the
|
||||||
/// driver script to race the GPU thread. If the driver script wins the
|
/// driver script to race the raster thread. If the driver script wins the
|
||||||
/// race, it will screenshot the previous frame. If the GPU thread wins
|
/// race, it will screenshot the previous frame. If the raster thread wins
|
||||||
/// it, it will screenshot the latest frame.
|
/// it, it will screenshot the latest frame.
|
||||||
void main() {
|
void main() {
|
||||||
enableFlutterDriverExtension();
|
enableFlutterDriverExtension();
|
||||||
@ -64,7 +64,7 @@ List<Widget> _buildRows(int count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Builds cells that are known to take time to render causing a delay on the
|
/// Builds cells that are known to take time to render causing a delay on the
|
||||||
/// GPU thread.
|
/// raster thread.
|
||||||
List<Widget> _buildCells(double epsilon) {
|
List<Widget> _buildCells(double epsilon) {
|
||||||
return List<Widget>.generate(15, (int i) {
|
return List<Widget>.generate(15, (int i) {
|
||||||
return Expanded(
|
return Expanded(
|
||||||
|
@ -44,9 +44,9 @@ mixin PaintingBinding on BindingBase, ServicesBinding {
|
|||||||
/// installation or a data wipe. The warm up does not block the main thread
|
/// installation or a data wipe. The warm up does not block the main thread
|
||||||
/// so there should be no "Application Not Responding" warning.
|
/// so there should be no "Application Not Responding" warning.
|
||||||
///
|
///
|
||||||
/// Currently the warm-up happens synchronously on the GPU thread which means
|
/// Currently the warm-up happens synchronously on the raster thread which
|
||||||
/// the rendering of the first frame on the GPU thread will be postponed until
|
/// means the rendering of the first frame on the raster thread will be
|
||||||
/// the warm-up is finished.
|
/// postponed until the warm-up is finished.
|
||||||
///
|
///
|
||||||
/// See also:
|
/// See also:
|
||||||
///
|
///
|
||||||
|
@ -24,9 +24,9 @@ import 'package:flutter/foundation.dart';
|
|||||||
/// done before calling [runApp].
|
/// done before calling [runApp].
|
||||||
///
|
///
|
||||||
/// To determine whether a draw operation is useful for warming up shaders,
|
/// To determine whether a draw operation is useful for warming up shaders,
|
||||||
/// check whether it improves the slowest GPU frame. Also, tracing with
|
/// check whether it improves the slowest frame rasterization time. Also,
|
||||||
/// `flutter run --profile --trace-skia` may reveal whether there is shader-
|
/// tracing with `flutter run --profile --trace-skia` may reveal whether
|
||||||
/// compilation-related jank. If there is such jank, some long
|
/// there is shader-compilation-related jank. If there is such jank, some long
|
||||||
/// `GrGLProgramBuilder::finalize` calls would appear in the middle of an
|
/// `GrGLProgramBuilder::finalize` calls would appear in the middle of an
|
||||||
/// animation. Their parent calls, which look like `XyzOp` (e.g., `FillRecOp`,
|
/// animation. Their parent calls, which look like `XyzOp` (e.g., `FillRecOp`,
|
||||||
/// `CircularRRectOp`) would suggest Xyz draw operations are causing the
|
/// `CircularRRectOp`) would suggest Xyz draw operations are causing the
|
||||||
@ -72,7 +72,7 @@ abstract class ShaderWarmUp {
|
|||||||
/// `flutter screenshot --observatory-uri=<uri> --type=skia`
|
/// `flutter screenshot --observatory-uri=<uri> --type=skia`
|
||||||
/// and analyze it with https://debugger.skia.org.
|
/// and analyze it with https://debugger.skia.org.
|
||||||
/// Alternatively, one may run the app with `flutter run --trace-skia` and
|
/// Alternatively, one may run the app with `flutter run --trace-skia` and
|
||||||
/// then examine the GPU thread in the observatory timeline to see which
|
/// then examine the raster thread in the observatory timeline to see which
|
||||||
/// Skia draw operations are commonly used, and which shader compilations
|
/// Skia draw operations are commonly used, and which shader compilations
|
||||||
/// are causing jank.
|
/// are causing jank.
|
||||||
@protected
|
@protected
|
||||||
|
@ -46,12 +46,13 @@ enum PerformanceOverlayOption {
|
|||||||
///
|
///
|
||||||
/// The overlay shows two time series. The first shows how much time was
|
/// The overlay shows two time series. The first shows how much time was
|
||||||
/// required on this thread to produce each frame. The second shows how much
|
/// required on this thread to produce each frame. The second shows how much
|
||||||
/// time was required on the GPU thread to produce each frame. Ideally, both
|
/// time was required on the raster thread (formerly known as the GPU thread)
|
||||||
/// these values would be less than the total frame budget for the hardware on
|
/// to produce each frame. Ideally, both these values would be less than
|
||||||
/// which the app is running. For example, if the hardware has a screen that
|
/// the total frame budget for the hardware on which the app is running.
|
||||||
/// updates at 60 Hz, each thread should ideally spend less than 16ms producing
|
/// For example, if the hardware has a screen that updates at 60 Hz, each
|
||||||
/// each frame. This ideal condition is indicated by a green vertical line for
|
/// thread should ideally spend less than 16ms producing each frame.
|
||||||
/// each thread. Otherwise, the performance overlay shows a red vertical line.
|
/// This ideal condition is indicated by a green vertical line for each thread.
|
||||||
|
/// Otherwise, the performance overlay shows a red vertical line.
|
||||||
///
|
///
|
||||||
/// The simplest way to show the performance overlay is to set
|
/// The simplest way to show the performance overlay is to set
|
||||||
/// [MaterialApp.showPerformanceOverlay] or [WidgetsApp.showPerformanceOverlay]
|
/// [MaterialApp.showPerformanceOverlay] or [WidgetsApp.showPerformanceOverlay]
|
||||||
|
@ -8,13 +8,14 @@ import 'framework.dart';
|
|||||||
|
|
||||||
/// Displays performance statistics.
|
/// Displays performance statistics.
|
||||||
///
|
///
|
||||||
/// The overlay show two time series. The first shows how much time was required
|
/// The overlay shows two time series. The first shows how much time was
|
||||||
/// on this thread to produce each frame. The second shows how much time was
|
/// required on this thread to produce each frame. The second shows how much
|
||||||
/// required on the GPU thread to produce each frame. Ideally, both these values
|
/// time was required on the raster thread (formerly known as the GPU thread)
|
||||||
/// would be less than the total frame budget for the hardware on which the app
|
/// to produce each frame. Ideally, both these values would be less than
|
||||||
/// is running. For example, if the hardware has a screen that updates at 60 Hz,
|
/// the total frame budget for the hardware on which the app is running.
|
||||||
/// each thread should ideally spend less than 16ms producing each frame. This
|
/// For example, if the hardware has a screen that updates at 60 Hz, each
|
||||||
/// ideal condition is indicated by a green vertical line for each thread.
|
/// thread should ideally spend less than 16ms producing each frame.
|
||||||
|
/// This ideal condition is indicated by a green vertical line for each thread.
|
||||||
/// Otherwise, the performance overlay shows a red vertical line.
|
/// Otherwise, the performance overlay shows a red vertical line.
|
||||||
///
|
///
|
||||||
/// The simplest way to show the performance overlay is to set
|
/// The simplest way to show the performance overlay is to set
|
||||||
|
@ -515,15 +515,16 @@ abstract class FlutterDriver {
|
|||||||
///
|
///
|
||||||
/// HACK: There will be a 2-second artificial delay before screenshotting,
|
/// HACK: There will be a 2-second artificial delay before screenshotting,
|
||||||
/// the delay here is to deal with a race between the driver script and
|
/// the delay here is to deal with a race between the driver script and
|
||||||
/// the GPU thread. The issue is that driver API synchronizes with the
|
/// the raster thread (formerly known as the GPU thread). The issue is
|
||||||
/// framework based on transient callbacks, which are out of sync with
|
/// that driver API synchronizes with the framework based on transient
|
||||||
/// the GPU thread. Here's the timeline of events in ASCII art:
|
/// callbacks, which are out of sync with the raster thread.
|
||||||
|
/// Here's the timeline of events in ASCII art:
|
||||||
///
|
///
|
||||||
/// -------------------------------------------------------------------
|
/// -------------------------------------------------------------------
|
||||||
/// Without this delay:
|
/// Without this delay:
|
||||||
/// -------------------------------------------------------------------
|
/// -------------------------------------------------------------------
|
||||||
/// UI : <-- build -->
|
/// UI : <-- build -->
|
||||||
/// GPU : <-- rasterize -->
|
/// Raster: <-- rasterize -->
|
||||||
/// Gap : | random |
|
/// Gap : | random |
|
||||||
/// Driver: <-- screenshot -->
|
/// Driver: <-- screenshot -->
|
||||||
///
|
///
|
||||||
@ -532,7 +533,7 @@ abstract class FlutterDriver {
|
|||||||
/// `screenshot()`. The gap is random because it is determined by the
|
/// `screenshot()`. The gap is random because it is determined by the
|
||||||
/// unpredictable network communication between the driver process and
|
/// unpredictable network communication between the driver process and
|
||||||
/// the application. If this gap is too short, which it typically will
|
/// the application. If this gap is too short, which it typically will
|
||||||
/// be, the screenshot is taken before the GPU thread is done
|
/// be, the screenshot is taken before the raster thread is done
|
||||||
/// rasterizing the frame, so the screenshot of the previous frame is
|
/// rasterizing the frame, so the screenshot of the previous frame is
|
||||||
/// taken, which is wrong.
|
/// taken, which is wrong.
|
||||||
///
|
///
|
||||||
@ -540,11 +541,11 @@ abstract class FlutterDriver {
|
|||||||
/// With this delay, if we're lucky:
|
/// With this delay, if we're lucky:
|
||||||
/// -------------------------------------------------------------------
|
/// -------------------------------------------------------------------
|
||||||
/// UI : <-- build -->
|
/// UI : <-- build -->
|
||||||
/// GPU : <-- rasterize -->
|
/// Raster: <-- rasterize -->
|
||||||
/// Gap : | 2 seconds or more |
|
/// Gap : | 2 seconds or more |
|
||||||
/// Driver: <-- screenshot -->
|
/// Driver: <-- screenshot -->
|
||||||
///
|
///
|
||||||
/// The two-second gap should be long enough for the GPU thread to
|
/// The two-second gap should be long enough for the raster thread to
|
||||||
/// finish rasterizing the frame, but not longer than necessary to keep
|
/// finish rasterizing the frame, but not longer than necessary to keep
|
||||||
/// driver tests as fast a possible.
|
/// driver tests as fast a possible.
|
||||||
///
|
///
|
||||||
@ -552,7 +553,7 @@ abstract class FlutterDriver {
|
|||||||
/// With this delay, if we're not lucky:
|
/// With this delay, if we're not lucky:
|
||||||
/// -------------------------------------------------------------------
|
/// -------------------------------------------------------------------
|
||||||
/// UI : <-- build -->
|
/// UI : <-- build -->
|
||||||
/// GPU : <-- rasterize randomly slow today -->
|
/// Raster: <-- rasterize randomly slow today -->
|
||||||
/// Gap : | 2 seconds or more |
|
/// Gap : | 2 seconds or more |
|
||||||
/// Driver: <-- screenshot -->
|
/// Driver: <-- screenshot -->
|
||||||
///
|
///
|
||||||
|
@ -74,8 +74,8 @@ class TimelineSummary {
|
|||||||
return _percentileInMillis(_extractGpuRasterizerDrawDurations(), p);
|
return _percentileInMillis(_extractGpuRasterizerDrawDurations(), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The number of frames that missed the [kBuildBudget] on the GPU and
|
/// The number of frames that missed the [kBuildBudget] on the raster thread
|
||||||
/// therefore are in the danger of missing frames.
|
/// and therefore are in the danger of missing frames.
|
||||||
int computeMissedFrameRasterizerBudgetCount([ Duration frameBuildBudget = kBuildBudget ]) => _extractGpuRasterizerDrawDurations()
|
int computeMissedFrameRasterizerBudgetCount([ Duration frameBuildBudget = kBuildBudget ]) => _extractGpuRasterizerDrawDurations()
|
||||||
.where((Duration duration) => duration > kBuildBudget)
|
.where((Duration duration) => duration > kBuildBudget)
|
||||||
.length;
|
.length;
|
||||||
|
@ -100,7 +100,8 @@ class RunCommand extends RunCommandBase {
|
|||||||
..addFlag('trace-skia',
|
..addFlag('trace-skia',
|
||||||
negatable: false,
|
negatable: false,
|
||||||
help: 'Enable tracing of Skia code. This is useful when debugging '
|
help: 'Enable tracing of Skia code. This is useful when debugging '
|
||||||
'the GPU thread. By default, Flutter will not log skia code.',
|
'the raster thread (formerly known as the GPU thread). '
|
||||||
|
'By default, Flutter will not log skia code.',
|
||||||
)
|
)
|
||||||
..addOption('trace-whitelist',
|
..addOption('trace-whitelist',
|
||||||
help: 'Filters out all trace events except those that are specified in '
|
help: 'Filters out all trace events except those that are specified in '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user