Highlight VSync support for embedders (flutter/engine#25247)
Chrome Trace viewer treats events labeled "VSYNC" as special and highlights them (when the "Highlight Vsync" checkbox is enabled). Ideally VSYNC events are generated by the host system at their source. System VSYNC events are indeed present in full-system systraces. Flutter-level traces (as seen in Observatory/Flutter devtools) do not contain the system VSYNC events, so we rely on the engine to generate them (as close to where they would be generated by the system ideally).
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "flutter/shell/common/vsync_waiter_fallback.h"
|
||||
|
||||
#include "flutter/fml/logging.h"
|
||||
#include "flutter/fml/trace_event.h"
|
||||
|
||||
namespace flutter {
|
||||
namespace {
|
||||
@@ -27,6 +28,8 @@ VsyncWaiterFallback::~VsyncWaiterFallback() = default;
|
||||
|
||||
// |VsyncWaiter|
|
||||
void VsyncWaiterFallback::AwaitVSync() {
|
||||
TRACE_EVENT0("flutter", "VSYNC");
|
||||
|
||||
constexpr fml::TimeDelta kSingleFrameInterval =
|
||||
fml::TimeDelta::FromSecondsF(1.0 / 60.0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user