Skip to content

Buffering display list for automatic re-painting causes infinitely growing display list #15

@khushalsagar

Description

@khushalsagar

In order to keep the element live, we need to keep buffering all commands which have been made to the 2D canvas. This allows re-composing the canvas buffer when the element's painting changes.

But this means you can have an infinitely growing display list which will tank perf in a way that might not be obvious to the author. There's a few ideas around it:

  • The browser detects when a command mutates the buffer such that all previous commands would be a no-op (clearRect for example). This could potentially also drop a subset of the commands, depending on the degree of optimization.
  • The browser could collapse commands into a texture so canvas has a stack of textures and placed elements.
  • The browser could dispatch an event forcing the author to redraw the canvas if the buffer has hit a limit

@smfr fyi.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions