Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Revert "Fix wrong VSYNC event" #37589

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions shell/common/vsync_waiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,6 @@ void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
bool pause_secondary_tasks) {
FML_DCHECK(fml::TimePoint::Now() >= frame_start_time);

// The event named "VSYNC" is special in `chrome://tracing` tool - it will
// have a zebra visualization.
fml::tracing::TraceTimelineEvent(
"flutter", "VSYNC", frame_start_time.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_Begin, {"frame_start_time", "frame_target_time"},
{std::to_string(frame_start_time.ToEpochDelta().ToMicroseconds()),
std::to_string(frame_target_time.ToEpochDelta().ToMicroseconds())});
fml::tracing::TraceTimelineEvent(
"flutter", "VSYNC", frame_target_time.ToEpochDelta().ToMicroseconds(), 0,
Dart_Timeline_Event_End, {}, {});

Callback callback;
std::vector<fml::closure> secondary_callbacks;

Expand Down
2 changes: 1 addition & 1 deletion shell/common/vsync_waiter_fallback.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ VsyncWaiterFallback::~VsyncWaiterFallback() = default;

// |VsyncWaiter|
void VsyncWaiterFallback::AwaitVSync() {
TRACE_EVENT0("flutter", "VsyncCallback");
TRACE_EVENT0("flutter", "VSYNC");

constexpr fml::TimeDelta kSingleFrameInterval =
fml::TimeDelta::FromSecondsF(1.0 / 60.0);
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/android/vsync_waiter_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void VsyncWaiterAndroid::AwaitVSync() {

// static
void VsyncWaiterAndroid::OnVsyncFromNDK(int64_t frame_nanos, void* data) {
TRACE_EVENT0("flutter", "VsyncCallback");
TRACE_EVENT0("flutter", "VSYNC");

auto frame_time = fml::TimePoint::FromEpochDelta(
fml::TimeDelta::FromNanoseconds(frame_nanos));
Expand All @@ -72,7 +72,7 @@ void VsyncWaiterAndroid::OnVsyncFromJava(JNIEnv* env,
jlong frameDelayNanos,
jlong refreshPeriodNanos,
jlong java_baton) {
TRACE_EVENT0("flutter", "VsyncCallback");
TRACE_EVENT0("flutter", "VSYNC");

auto frame_time =
fml::TimePoint::Now() - fml::TimeDelta::FromNanoseconds(frameDelayNanos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ - (void)pause {
}

- (void)onDisplayLink:(CADisplayLink*)link {
TRACE_EVENT0("flutter", "VsyncCallback");
TRACE_EVENT0("flutter", "VSYNC");

CFTimeInterval delay = CACurrentMediaTime() - link.timestamp;
fml::TimePoint frame_start_time = fml::TimePoint::Now() - fml::TimeDelta::FromSecondsF(delay);
Expand Down