Skip to content

[DisplayList] Improve DisplayList detection of non-operations #125338

@flar

Description

@flar

Sometimes the DisplayList is asked to record operations that can be demonstrated will have no effect. Much of the time this property can be easily determined up front while recording the DL, such as:

  • The bounds of the primitive are empty
  • The alpha of the color is zero
  • The clip is empty

None of these conditions are tested which means we produce DisplayList objects that have extra Operation records that will perform no work.

This situation is important enough that some parts of the Flutter engine work around the problem by reading back the list of operations to see if any of them actually impact the destination surface. See:

These classes could be eliminated if the DL performed the same tests as it was constructing the list of operations and could then return either or both of an empty bounds or a zero count of operations.

See: #125318 and flutter/engine#40578 for examples of where this deficiency had to be worked around.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions