Flutter Engine
The Flutter Engine
|
#include <volatile_path_tracker.h>
Classes | |
struct | TrackedPath |
The fields of this struct must only accessed on the UI task runner. More... | |
Public Member Functions | |
VolatilePathTracker (fml::RefPtr< fml::TaskRunner > ui_task_runner, bool enabled) | |
void | Track (const std::shared_ptr< TrackedPath > &path) |
void | OnFrame () |
bool | enabled () const |
Static Public Attributes | |
static constexpr int | kFramesOfVolatility = 2 |
Friends | |
class | testing::ShellTest |
A cache for paths drawn from dart:ui.
Whenever a flutter::CanvasPath is created, it must Insert an entry into this cache. Whenever a frame is drawn, the shell must call OnFrame. The cache will flip the volatility bit on the SkPath and remove it from the cache. If the Dart object is released, Erase must be called to avoid tracking a path that is no longer referenced in Dart code.
Enabling this cache may cause difficult to predict minor pixel differences when paths are rendered. If deterministic rendering is needed, e.g. for a screen diffing test, this class will not cache any paths and will automatically set the volatility of the path to false.
Definition at line 36 of file volatile_path_tracker.h.
flutter::VolatilePathTracker::VolatilePathTracker | ( | fml::RefPtr< fml::TaskRunner > | ui_task_runner, |
bool | enabled | ||
) |
Definition at line 11 of file volatile_path_tracker.cc.
|
inline |
Definition at line 65 of file volatile_path_tracker.h.
void flutter::VolatilePathTracker::OnFrame | ( | ) |
Definition at line 27 of file volatile_path_tracker.cc.
void flutter::VolatilePathTracker::Track | ( | const std::shared_ptr< TrackedPath > & | path | ) |
Definition at line 16 of file volatile_path_tracker.cc.
|
friend |
Definition at line 72 of file volatile_path_tracker.h.
|
staticconstexpr |
Definition at line 48 of file volatile_path_tracker.h.