未验证 提交 8594a914 编写于 作者: K Kaushik Iska 提交者: GitHub

Highlight VSync support for embedders (#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).
上级 7e184910
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册