handleDrawFrame method
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() {
if (_drawFrame == _HandleDrawFrame.reset) {
throw StateError('handleDrawFrame() called without paired handleBeginFrame()');
}
if (_drawFrame == _HandleDrawFrame.drawFrame) {
super.handleDrawFrame();
}
_drawFrame = _HandleDrawFrame.reset;
_viewNeedsPaint = false;
_expectingFrameToReassemble = false;
if (_expectingFrame) { // set during pump
assert(_pendingFrame != null);
_pendingFrame!.complete(); // unlocks the test API
_pendingFrame = null;
_expectingFrame = false;
} else if (framePolicy != LiveTestWidgetsFlutterBindingFramePolicy.benchmark) {
platformDispatcher.scheduleFrame();
}
}