Merge pull request #2517 from Hixie/addPerformanceOverlay-docs

Flesh out docs for addPerformanceOverlay
This commit is contained in:
Ian Hickson 2016-03-17 11:14:15 -07:00
commit 0b4e8affd9

View File

@ -102,6 +102,25 @@ class SceneBuilder extends NativeFieldWrapperClass2 {
/// Useful during development to assess the performance of the application.
/// The enabledOptions controls which statistics are displayed. The bounds
/// controls where the statistics are displayed.
///
/// enabledOptions is a bit field with the following bits defined:
/// * 0x01: displayRasterizerStatistics - show GPU thread frame time
/// * 0x02: visualizeRasterizerStatistics - graph GPU thread frame times
/// * 0x04: displayEngineStatistics - show UI thread frame time
/// * 0x08: visualizeEngineStatistics - graph UI thread frame times
/// Set enabledOptions to 0x0F to enable all the currently defined features.
///
/// The "UI thread" is the thread that includes all the execution of
/// the main Dart isolate (the isolate that can call
/// [Window.render]). The UI thread frame time is the total time
/// spent executing the [Window.onBeginFrame] callback. The "GPU
/// thread" is the thread (running on the CPU) that subsequently
/// processes the [Scene] provided by the Dart code to turn it into
/// GPU commands and send it to the GPU.
///
/// See also the [PerformanceOverlayOption] enum in the rendering library.
/// for more details.
// Values above must match constants in //engine/src/sky/compositor/performance_overlay_layer.h
void addPerformanceOverlay(int enabledOptions, Rect bounds) native "SceneBuilder_addPerformanceOverlay";
/// Adds a [Picture] to the scene.