-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Use case
There is significant code duplication in EngineScene rendering and CanvasKit rendering. For example the Layer system in the EngineScene scheme: https://github.com/flutter/engine/blob/f720a03ede2c9821006fb1f21fb2917eb757b9d5/lib/web_ui/lib/src/engine/layers.dart and the CanvasKit renderer: https://github.com/flutter/engine/blob/1d2fd46d01da499578ffd180da04ad60f299bfc8/lib/web_ui/lib/src/engine/canvaskit/layer.dart
I also plan to duplicate the logic to only render one frame at a time and drop frames when multiple are queued before the current frame is done rendering from EngineSceneView: https://github.com/flutter/engine/blob/3837195399c4c002e874dae34f4305b4f3eb7d09/lib/web_ui/lib/src/engine/scene_view.dart
Proposal
EngineScene is written to be renderer-agnostic, so we should attempt to port CanvasKit rendering to use this Layer logic instead. This will reduce code duplication and our maintenance burden.