handleDrawFrame method
- @override
override
Called by the engine to produce a new frame.
This method is called immediately after handleBeginFrame. It calls all the callbacks registered by addPersistentFrameCallback, which typically drive the rendering pipeline, and then calls the callbacks registered by addPostFrameCallback.
See handleBeginFrame for a discussion about debugging hooks that may be useful when working with frame callbacks.
Implementation
@override
void handleDrawFrame() {
assert(_doDrawThisFrame != null);
if (_doDrawThisFrame)
super.handleDrawFrame();
_doDrawThisFrame = null;
_viewNeedsPaint = false;
if (_expectingFrame) { // set during pump
assert(_pendingFrame != null);
_pendingFrame.complete(); // unlocks the test API
_pendingFrame = null;
_expectingFrame = false;
} else {
assert(framePolicy != LiveTestWidgetsFlutterBindingFramePolicy.benchmark);
ui.window.scheduleFrame();
}
}