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

Sequester all Skia<->DL interactions into the skia sub-module #40083

Merged
merged 7 commits into from
Mar 6, 2023

Conversation

flar
Copy link
Contributor

@flar flar commented Mar 6, 2023

Most of the big objects that dealt with Skia interaction have already been moved into the skia sub-directory, but there were a few smaller uses of conversions that were scattered throughout the main body of DisplayList source code. This PR essentially pulled on a Skia root and kept pulling until a large number of Skia references were removed from the main body or sequestered into the skia sub-directory, including:

  • Dispatcher was renamed to DlOpReceiver and many Skia enums and minor references removed from its methods
  • DisplayListBuilder used to allow access to its OpReceiver methods through a public asReceiver() method. These methods now require special "friend" access only granted to a test file and a benchmark file that check regressions on internal state.
  • Removed DisplayList::RenderTo(SkCanvas) method that knew how to interface with Skia. That code is now embedded in the DlSkCanvasAdapter instead and DisplayList only supports dispatching to a DlOpReciever now.
  • moved SkPaintDispatchHelper into the skia sub-directory where its only use lies
  • removed all "DlThing ToDl(SkThing)" converter functions as they are obsolete
  • moved all "SkThing ToSk(DlThing)" converter functions to skia where their only uses lie
  • moved all "DlThing::skia_object" methods into ToSk converter functions in the skia sub-directory where their only uses lie

There should be minimal use of SkObjects in the main body of the DL source code, but the following remain:

  • Some test files use Skia objects to compare behavior of the DL equivalents
  • Many interfaces still include SkScalar, SkRect, SkPath, SkMatrix, SkM44 and maybe a few other utility geometric objects

@flar
Copy link
Contributor Author

flar commented Mar 6, 2023

@dnfield I removed a piece of code that protected color source access from the wrong thread in lib/ui/paint.cc when I removed the Paint::paint(SkPaint& paint) method now that it is no longer needed for the paragraph code. It feels like a similar protection is probably needed in DlSkCanvasAdapter and/or DlSkCanvasDispatcher which translate from DL objects to Sk objects for talking to an SkCanvas. The comment there indicated that the protection was only situationally needed when accessing a ui.Paint from the paragraph code. Is that still true after this re-configuration of the DL code?

Note that the paragraph code still calls the Paint::toDlPaint(DlPaint& paint) method which performs a similar operation for it, but entirely using DL data structures. That code doesn't have the "owner" protection in it, though...

@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 6, 2023
@auto-submit auto-submit bot merged commit b053d74 into flutter:main Mar 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
auto-submit bot pushed a commit that referenced this pull request Mar 7, 2023
…#40083)" (#40103)

Revert "Sequester all Skia<->DL interactions into the skia sub-module (#40083)"
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 7, 2023
flar added a commit to flar/engine that referenced this pull request Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants