Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make Animator::Render skip
  • Loading branch information
dkwingsmt committed Oct 23, 2023
commit 3df67782bfaef50d02cd7621465334c412f07d8d
11 changes: 10 additions & 1 deletion shell/common/animator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,18 @@ void Animator::EndFrame() {
void Animator::Render(int64_t view_id,
std::unique_ptr<flutter::LayerTree> layer_tree,
float device_pixel_ratio) {
// Animator::Render should be called between BeginFrame and EndFrame,
// which is indicated by frame_timings_recorder_ being non-null.
// This might happen on release build, and is guarded by PlatformDispatcher on
// debug build.
// TODO(dkwingsmt): We should change this skip into an assertion.
// https://github.com/flutter/flutter/issues/137073
if (frame_timings_recorder_ == nullptr) {
return;
}

has_rendered_ = true;

FML_CHECK(frame_timings_recorder_ != nullptr);
TRACE_EVENT_WITH_FRAME_NUMBER(frame_timings_recorder_, "flutter",
"Animator::Render", /*flow_id_count=*/0,
/*flow_ids=*/nullptr);
Expand Down
2 changes: 1 addition & 1 deletion shell/common/animator.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Animator final {
///
/// This method must be called during a vsync callback, or
/// technically, between Animator::BeginFrame and Animator::EndFrame
/// (both private methods).
/// (both private methods). Otherwise, this call will be ignored.
///
void Render(int64_t view_id,
std::unique_ptr<flutter::LayerTree> layer_tree,
Expand Down