mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
DisplayListBuilder grew over time from a class that implemented a developer-unfriendly stateful API into one that implemented both the developer-friendly DlCanvas API as well as its original stateful API. Over time, the stateful API was buried under a "testing only" facade. In the meantime, the optimization features that it applies to the DlCanvas calls before it records the operations in a DlOp store are useful without the recording process and so I've been wanting to break those into 2 parts for a while with the goal of removing all stateful APIs from DisplayListBuilder (see https://github.com/flutter/flutter/issues/108303). This PR takes a major step along that direction by splitting DisplayListBuilder into essentially a convenience class that marries 2 new classes together to achieve its old functionality: - `DlCanvasToReceiver` - a class that implements DlCanvas, optimizes common situations, and then sends commands to any object that implements `DlOpReceiver` - `DlOpRecorder` - an implementation of DlOpReceiver that records the operations in a buffer from which to create a `DisplayList` object - `DisplayListBuilder` now inherits from DlCanvasToReceiver to get the optimizations and provides it with an instance of `DlOpRecorder` as the receiver that it will send its results to - Similarly, a `DlCanvasToReceiver` instance could be directed to an `impeller:DlDispatcher` to achieve a more straight-through path from the DlCanvas interface to impeller Pictures.
Description
Flutter makes it easy and fast to build beautiful apps for mobile and beyond
androidapp-frameworkcross-platformdartdart-platformdesktopflutterflutter-packagefuchsiaioslinux-desktopmacosmaterial-designmobilemobile-developmentskiawebweb-frameworkwindows
2.5 GiB
Languages
Dart
75%
C++
16.5%
Objective-C++
2.9%
Java
2.8%
Objective-C
0.7%
Other
1.9%