Skip to content

Adding a item to the layer tree pipeline causing a redundant Rasterizer::Draw when pipeline is not empty #98959

@ColdPaleLight

Description

@ColdPaleLight

When we call Animator::Render to render the layer tree, if the pipeline is not empty before we put the new item, there are two places will try to render the layer tree.

One is here:
https://github.com/flutter/engine/blob/7b5edec4cd13fd948fa12c0cacdf5d1852b0149f/shell/common/rasterizer.cc#L215-L226
Another is here:
https://github.com/flutter/engine/blob/7b5edec4cd13fd948fa12c0cacdf5d1852b0149f/shell/common/shell.cc#L1125-L1129

One of these two is unnecessary, because there is nothing in the pipeline when calling Rasterizer::Draw.

A potential solution is to determine if the item put into the pipeline is the first one, if not, don't call Shell::OnAnimatorDraw,

c.f.
https://github.com/flutter/engine/blob/7b5edec4cd13fd948fa12c0cacdf5d1852b0149f/shell/common/animator.cc#L178-L184

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: tech-debtTechnical debt, code quality, testing, etc.engineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions