Revert "Re-land "Add option to delay rendering the first frame (#45135)" (#45588)" (#45939)

This reverts commit c59151b1cd.
This commit is contained in:
Kate Lovett
2019-12-02 15:08:35 -08:00
committed by GitHub
parent 8c25328014
commit cd052a56cb
6 changed files with 37 additions and 319 deletions

View File

@@ -687,9 +687,6 @@ abstract class TestWidgetsFlutterBinding extends BindingBase
runApp(Container(key: UniqueKey(), child: _preTestMessage)); // Reset the tree to a known state.
await pump();
// Pretend that the first frame produced in the test body is the first frame
// sent to the engine.
resetFirstFrameSent();
final bool autoUpdateGoldensBeforeTest = autoUpdateGoldenFiles && !isBrowser;
final TestExceptionReporter reportTestExceptionBeforeTest = reportTestException;
@@ -966,31 +963,6 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
return result;
}
int _firstFrameDeferredCount = 0;
bool _firstFrameSent = false;
@override
bool get sendFramesToEngine => _firstFrameSent || _firstFrameDeferredCount == 0;
@override
void deferFirstFrame() {
assert(_firstFrameDeferredCount >= 0);
_firstFrameDeferredCount += 1;
}
@override
void allowFirstFrame() {
assert(_firstFrameDeferredCount > 0);
_firstFrameDeferredCount -= 1;
// Unlike in RendererBinding.allowFirstFrame we do not force a frame her
// to give the test full control over frame scheduling.
}
@override
void resetFirstFrameSent() {
_firstFrameSent = false;
}
EnginePhase _phase = EnginePhase.sendSemanticsUpdate;
// Cloned from RendererBinding.drawFrame() but with early-exit semantics.
@@ -1007,8 +979,7 @@ class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding {
pipelineOwner.flushCompositingBits();
if (_phase != EnginePhase.compositingBits) {
pipelineOwner.flushPaint();
if (_phase != EnginePhase.paint && sendFramesToEngine) {
_firstFrameSent = true;
if (_phase != EnginePhase.paint) {
renderView.compositeFrame(); // this sends the bits to the GPU
if (_phase != EnginePhase.composite) {
pipelineOwner.flushSemantics();