Skip to content

RenderOpacity sometimes omits its layer during animations which breaks caching performance #58425

@flar

Description

@flar

The RenderOpacity object will not emit a layer when the opacity is 0 or 255. If that is the static opacity then it might make sense, but when it is the value during an animation, this causes the layer tree to drastically change configuration on each frame.

While this could potentially result in a hit if the tree needs to be constantly reconstructed, an even bigger hit happens because the change of identity of its own layer as it moves from a partial value to either 0 or 255 and back again means that the cached information at the engine level needs to be discarded and then re-rendered.

The layer should absolutely be left intact even for opacity values of 0 or 255 during an animation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: animationAnimation APIsframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions