-
Notifications
You must be signed in to change notification settings - Fork 6k
Multiview pipeline #44473
Multiview pipeline #44473
Changes from 1 commit
d36a55d
3812621
b1b68eb
5e036d8
ba42c07
fba2c7c
d7c6510
968c7e9
752a0a4
c912775
2a87664
adf5b8f
f1a497b
f31f60c
9d68f3c
7af9496
2e539c6
d20363e
3d5a190
ba845c7
4fc4922
db9a99c
a098175
2128688
4f049cd
c795035
03520e2
285c0f6
9c92de2
86bd921
a898834
2ff8609
c61cf67
d9fc2a5
e99900a
89755d2
42db5c3
164ca90
3e2902b
26d3cbe
8db91df
8d718d5
0d3f6fb
5cb56f8
6264164
a1b0740
b3284aa
a7e033b
2fb045b
257f7cc
9bb1d75
90020f4
ed46975
eb00183
7c24ab8
4e2d39a
a3b7567
5c7c313
9b6210e
9c888ec
8d14e6d
29aea0a
3f17841
6589d45
a762a11
2bead3f
50b7031
f08c963
87c73c4
2a5a715
b74574b
a705321
7f7d0ad
a0dd49a
629ea33
02ba1b9
29972e0
dfbd19e
b792ff7
be6804b
25cf6f5
34bf49a
0c2f053
862a318
56cd636
1f411ec
6cec636
8021575
ae3e06e
b037f9a
4f34de0
1b21cea
181a94b
3523e91
e7bd8fe
7a1436d
918cf19
199ff4a
55b57b2
9544da9
4c9a11a
39dfbc6
fc44a61
d52f4f6
3a9cfb1
d570066
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,7 @@ void Animator::EnqueueTraceFlowId(uint64_t trace_flow_id) { | |
|
|
||
| void Animator::BeginFrame( | ||
| std::unique_ptr<FrameTimingsRecorder> frame_timings_recorder) { | ||
| FML_CHECK(frame_timings_recorder_ == nullptr); | ||
| TRACE_EVENT_ASYNC_END0("flutter", "Frame Request Pending", | ||
| frame_request_number_); | ||
| frame_request_number_++; | ||
|
|
@@ -112,21 +113,34 @@ void Animator::BeginFrame( | |
| dart_frame_deadline_ = frame_target_time.ToEpochDelta(); | ||
| uint64_t frame_number = frame_timings_recorder_->GetFrameNumber(); | ||
| delegate_.OnAnimatorBeginFrame(frame_target_time, frame_number); | ||
| } | ||
|
|
||
| // Commit the pending continuation. | ||
| PipelineProduceResult result = | ||
| producer_continuation_.Complete(std::make_unique<FrameItem>( | ||
| std::move(layer_trees_tasks_), std::move(frame_timings_recorder_))); | ||
|
|
||
| if (!result.success) { | ||
| FML_DLOG(INFO) << "Failed to commit to the pipeline"; | ||
| } else if (!result.is_first_item) { | ||
| // Do nothing. It has been successfully pushed to the pipeline but not as | ||
| // the first item. Eventually the 'Rasterizer' will consume it, so we don't | ||
| // need to notify the delegate. | ||
| } else { | ||
| delegate_.OnAnimatorDraw(layer_tree_pipeline_); | ||
| void Animator::EndFrame() { | ||
| FML_CHECK(frame_timings_recorder_ != nullptr); | ||
| if (!layer_trees_tasks_.empty()) { | ||
| // The build is completed in OnAnimatorBeginFrame. | ||
| frame_timings_recorder_->RecordBuildEnd(fml::TimePoint::Now()); | ||
|
|
||
| delegate_.OnAnimatorUpdateLatestFrameTargetTime( | ||
| frame_timings_recorder_->GetVsyncTargetTime()); | ||
|
|
||
| // Commit the pending continuation. | ||
| PipelineProduceResult result = | ||
| producer_continuation_.Complete(std::make_unique<FrameItem>( | ||
| std::move(layer_trees_tasks_), std::move(frame_timings_recorder_))); | ||
|
|
||
| if (!result.success) { | ||
| FML_DLOG(INFO) << "Failed to commit to the pipeline"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This falls through where it used to return early. Do we really want to continue below in this case?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I was developing this PR I had the same question, but I think the current way is keeping the old behavior. Before the PR, although when If this logic seems questionable, I can open an issue to remind further checking. |
||
| } else if (!result.is_first_item) { | ||
| // Do nothing. It has been successfully pushed to the pipeline but not as | ||
| // the first item. Eventually the 'Rasterizer' will consume it, so we | ||
| // don't need to notify the delegate. | ||
| } else { | ||
| delegate_.OnAnimatorDraw(layer_tree_pipeline_); | ||
| } | ||
| } | ||
| FML_DCHECK(layer_trees_tasks_.empty()); | ||
| frame_timings_recorder_ = nullptr; // Ensure it's cleared. | ||
|
|
||
| if (!frame_scheduled_ && has_rendered_) { | ||
| // Wait a tad more than 3 60hz frames before reporting a big idle period. | ||
|
|
@@ -165,10 +179,6 @@ void Animator::Render(int64_t view_id, | |
| TRACE_EVENT_WITH_FRAME_NUMBER(frame_timings_recorder_, "flutter", | ||
| "Animator::Render", /*flow_id_count=*/0, | ||
| /*flow_ids=*/nullptr); | ||
| frame_timings_recorder_->RecordBuildEnd(fml::TimePoint::Now()); | ||
|
|
||
| delegate_.OnAnimatorUpdateLatestFrameTargetTime( | ||
| frame_timings_recorder_->GetVsyncTargetTime()); | ||
|
|
||
| layer_trees_tasks_.push_back(std::make_unique<LayerTreeTask>( | ||
| view_id, std::move(layer_tree), device_pixel_ratio)); | ||
|
|
@@ -243,6 +253,7 @@ void Animator::AwaitVSync() { | |
| self->DrawLastLayerTrees(std::move(frame_timings_recorder)); | ||
| } else { | ||
| self->BeginFrame(std::move(frame_timings_recorder)); | ||
| self->EndFrame(); | ||
| } | ||
| } | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Consider a (debug-only) operator to convert the state to a friendly string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.