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

Method onDidDraw

snap_drawing/src/snap_drawing/cpp/Drawing/DrawLooper.cpp:223–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223void DrawLooper::onDidDraw(DrawLooperEntry& entry,
224 const Ref<DisplayList>& displayList,
225 const CompositorPlaneList* planeList) {
226 auto entriesLock = getEntriesLock();
227
228 if (planeList != nullptr) {
229 if (entry.surfacePresentersNeedUpdate(*planeList)) {
230 // Release the lock before taking the draw lock, to follow the same
231 // locking ordering used in drawFrames
232 entriesLock.unlock();
233 auto drawLock = getDrawLock();
234 entriesLock.lock();
235
236 {
237 VALDI_TRACE("SnapDrawing.updateSurfacePresenters");
238 entry.updateSurfacePresenters(*planeList);
239 }
240 entry.enqueueDisplayList(displayList);
241
242 if (entry.getDrawState().needsSynchronousDraw()) {
243 drawEntry(entry);
244
245 if (!_managedGraphicsContexts.empty()) {
246 schedulePerformCleanup(CleanUpMode::PostDraw);
247 }
248 }
249
250 return;
251 }
252 }
253
254 entry.enqueueDisplayList(displayList);
255}
256
257void DrawLooper::drawEntry(DrawLooperEntry& entry) {
258 DrawOperationsBatch batch;

Callers 1

processFrameMethod · 0.45

Calls 8

enqueueDisplayListMethod · 0.80
getDrawStateMethod · 0.80
unlockMethod · 0.45
lockMethod · 0.45
needsSynchronousDrawMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected