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

Method getDrawState

snap_drawing/src/snap_drawing/cpp/Drawing/DrawLooperEntry.cpp:22–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20DrawLooperEntry::~DrawLooperEntry() = default;
21
22DrawLooperEntryDrawState DrawLooperEntry::getDrawState() const {
23 DrawLooperEntryDrawState drawState;
24 if (_displayList == nullptr) {
25 return drawState;
26 }
27
28 auto frameTime = _displayList->getFrameTime();
29
30 for (const auto& surfacePresenter : _surfacePresenters) {
31 if (surfacePresenter.needsDrawForFrameTime(frameTime)) {
32 drawState.needsDraw = true;
33 if (surfacePresenter.needsSynchronousDraw()) {
34 drawState.prefersSynchronousDraw = true;
35 }
36 }
37 }
38
39 return drawState;
40}
41
42bool DrawLooperEntry::needsProcessFrameAtTime(TimePoint frameTime) const {
43 return _layerRoot->needsProcessFrame() &&

Callers 5

onDidDrawMethod · 0.80
collectDrawOperationsMethod · 0.80
drawFramesMethod · 0.80
processFramesMethod · 0.80

Calls 3

getFrameTimeMethod · 0.80
needsDrawForFrameTimeMethod · 0.80
needsSynchronousDrawMethod · 0.45

Tested by

no test coverage detected