engine icon indicating copy to clipboard operation
engine copied to clipboard

create a DlCanvas class and a DlCanvas->SkCanvas adapter

Open flar opened this issue 3 years ago • 0 comments

Introduces a new DlCanvas pure virtual API class that mirrors SkCanvas and provides a common API for talking to either an SkCanvas (through an adapter) or a DisplayListBuilder (which already was implementing it natively).

The new API will allow us to use a single DlCanvas pointer in PaintContext for data-loss-less rendering whether we are talking directly to Skia (the current default for all Flutter apps) or to Impeller.

An adapter is provided to express the DlCanvas calls to a wrapped SkCanvas.

DisplayListBuilder already provided all of these methods and so it now declares that it inherits from the new API class to provide the common API ground.

TBD:

  • [ ] convert PaintContext to provide only DlCanvas for (leaf) rendering.
  • [ ] convert all layers to speak DlCanvas instead of SkCanvas
    • [ ] (and remove conditional SkCanvas branches in layers that can talk to either)
  • [ ] convert mechanisms like RasterContext, the CacheItems and the like to use DlCanvas

flar avatar Aug 29 '22 10:08 flar