Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

create a DlCanvas class and a DlCanvas->SkCanvas adapter #35774

Closed
wants to merge 2 commits into from

Conversation

flar
Copy link
Contributor

@flar flar commented Aug 29, 2022

Fixes flutter/flutter#109578

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 flar added the Work in progress (WIP) Not ready (yet) for review! label Aug 29, 2022
@chinmaygarde
Copy link
Member

This is on @flar s stack.

@chinmaygarde
Copy link
Member

Is this necessary anymore?

@flar
Copy link
Contributor Author

flar commented Feb 24, 2023

Replaced by #39762

@flar flar closed this Feb 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Work in progress (WIP) Not ready (yet) for review!
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[DisplayList] Create a DisplayListBuilder-style interface that can either record a DisplayList or dispatch to an SkCanvas
2 participants