Jonah Williams 32aa60630b [Impeller] remove heap allocation of most geometry objects. (flutter/engine#55677)
Almost all geometry objects can now be stack allocated while rendering, instead of heap allocated - due to the removal of the EntityPass compositor. Clip geometries must still be heap allocated as the geometry objects are not yet stored in the display list, and the clips must be recorded for backdrop filter clip replay.

The canvas stores unique_ptrs to these geometries in a vector that it clears at the end of the frame. The Geometry factory methods were adjusted to return unique ptrs, and the Geometry class given a virtual dtor since we no longer rely on the special property of std::shared_ptr for memorizing the right dtor.

The ColorSourceContents and ClipContents class now hold onto a const ptr to the geometry object.

At some point in the future, we can rework the geometry object to be stored inline in the display list which will further simplify this code.

Part of https://github.com/flutter/flutter/issues/142054
2024-10-08 19:55:21 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%