Skip to content

Remove stateful attribute interfaces from DisplayListBuilder #108303

@flar

Description

@flar

DisplayListBuilder has similar stateful interfaces like the clip and transform methods similar to other graphics packages, but it also has stateful interfaces for attributes (color, filters, alpha, stroke parameters, etc.) which are much less common. The clip and transform states are typically things you want to inherit across an entire rendering cycle, the attributes - much less so.

As of flutter/engine#32860 the Builder class now has optional rendering operations that are stateless with respect to the rendering attributes.

Given the relative ease of use for the stateless interface (in that you don't have to worry about the previous state for many attributes that you don't want to accidentally inherit), it would probably be best if we deleted the attribute-stateful methods from DisplayListBuilder, leaving only clip and transform as remaining state.

Note that this would not require the actual DisplayList storage mechanism to embrace stateless attributes, but the synchronization of the attributes between calls made on Builder would be handled behind the scenes for the convenience of the developers using the Builder interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectengineflutter/engine related. See also e: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    Status

    🛠️ Internals

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions