Skip to content

RasterCache draw methods should take a DisplayListBuilder #102331

@flar

Description

@flar

We are approaching a time when the entire tree will be rendered through DisplayList objects and so when needed we should be modifying the sub-systems to work with both SkCanvas and DisplayListBuilder.

Right now for those parts of the system that speak to SkCanvas we recapture their rendering operations into a DisplayList using a DisplayListCanvasRecorder, but one of the pieces of that strategy that causes some churn in the created DisplayList objects is the drawImage() method which receives an SkImage and converts it into a new unique DlImage by wrapping it. So, each DisplayList that was generated using a drawImage() object will not compare to an identical DisplayList generated separately because the identities of the sk_sp<DlImage> will be different.

The only place this currently affects us is when doing rendering testing in unit tests and looking for identical DisplayLists. If the rendering involved a cache draw, then the two DisplayLists won't match.

If the RasterCache stored its images as DlImage and if draw methods took a(n optional) DisplayListBuilder to draw into, then these unit tests could see a consistent, and comparable, DisplayList.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/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