MCPcopy Create free account
hub / github.com/Snapchat/Valdi / addLayerRoot

Method addLayerRoot

snap_drawing/src/snap_drawing/cpp/Drawing/DrawLooper.cpp:90–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88DrawLooper::~DrawLooper() = default;
89
90void DrawLooper::addLayerRoot(const Ref<LayerRoot>& layerRoot,
91 const Ref<SurfacePresenterManager>& surfacePresenterManager,
92 bool disallowSynchronousDraw) {
93 DrawLooperEntryListener* listener = this;
94 auto entry = Valdi::makeShared<DrawLooperEntry>(layerRoot, surfacePresenterManager, listener);
95 entry->setDisallowSynchronousDraw(disallowSynchronousDraw);
96
97 {
98 auto lock = getEntriesLock();
99 SC_ASSERT(getEntryForLayer(*layerRoot) == nullptr);
100
101 _entries.emplace_back(entry);
102 layerRoot->setListener(entry.get());
103 scheduleProcessFrame(lock);
104 }
105
106 layerRoot->setChildNeedsDisplay();
107}
108
109void DrawLooper::removeLayerRoot(const Ref<LayerRoot>& layerRoot) {
110 Ref<DrawLooperEntry> entry;

Callers 3

addToDrawLooperMethod · 0.80
addLayerRootToLooperMethod · 0.80
TESTFunction · 0.80

Calls 4

setListenerMethod · 0.65
getMethod · 0.65
setChildNeedsDisplayMethod · 0.45

Tested by 2

addLayerRootToLooperMethod · 0.64
TESTFunction · 0.64