@@ -308,9 +308,8 @@ class PlatformDispatcher {
308308 _invoke (onMetricsChanged, _onMetricsChangedZone);
309309 }
310310
311- // A debug-only variable that stores the [FlutterView]s for which
312- // [FlutterView.render] has already been called during the current
313- // [onBeginFrame]/[onDrawFrame] callback sequence.
311+ // The [FlutterView]s for which [FlutterView.render] has already been called
312+ // during the current [onBeginFrame]/[onDrawFrame] callback sequence.
314313 //
315314 // It is null outside the scope of those callbacks indicating that calls to
316315 // [FlutterView.render] must be ignored. Furthermore, if a given [FlutterView]
@@ -320,16 +319,9 @@ class PlatformDispatcher {
320319 // Between [onBeginFrame] and [onDrawFrame] the properties value is
321320 // temporarily stored in `_renderedViewsBetweenCallbacks` so that it survives
322321 // the gap between the two callbacks.
323- //
324- // In release build, this variable is null, and therefore the calling rule is
325- // not enforced. This is because the check might hurt cold startup delay;
326- // see https://github.com/flutter/engine/pull/46919.
327- Set <FlutterView >? _debugRenderedViews;
328- // A debug-only variable that temporarily stores the `_renderedViews` value
329- // between `_beginFrame` and `_drawFrame`.
330- //
331- // In release build, this variable is null.
332- Set <FlutterView >? _debugRenderedViewsBetweenCallbacks;
322+ Set <FlutterView >? _renderedViews;
323+ // The `_renderedViews` value between `_beginFrame` and `_drawFrame`.
324+ Set <FlutterView >? _renderedViewsBetweenCallbacks;
333325
334326 /// A callback invoked when any view begins a frame.
335327 ///
@@ -351,26 +343,20 @@ class PlatformDispatcher {
351343
352344 // Called from the engine, via hooks.dart
353345 void _beginFrame (int microseconds) {
354- assert (_debugRenderedViews == null );
355- assert (_debugRenderedViewsBetweenCallbacks == null );
356- assert (() {
357- _debugRenderedViews = < FlutterView > {};
358- return true ;
359- }());
346+ assert (_renderedViews == null );
347+ assert (_renderedViewsBetweenCallbacks == null );
348+ _renderedViews = < FlutterView > {};
360349
361350 _invoke1 <Duration >(
362351 onBeginFrame,
363352 _onBeginFrameZone,
364353 Duration (microseconds: microseconds),
365354 );
366355
367- assert (_debugRenderedViews != null );
368- assert (_debugRenderedViewsBetweenCallbacks == null );
369- assert (() {
370- _debugRenderedViewsBetweenCallbacks = _debugRenderedViews;
371- _debugRenderedViews = null ;
372- return true ;
373- }());
356+ assert (_renderedViews != null );
357+ assert (_renderedViewsBetweenCallbacks == null );
358+ _renderedViewsBetweenCallbacks = _renderedViews;
359+ _renderedViews = null ;
374360 }
375361
376362 /// A callback that is invoked for each frame after [onBeginFrame] has
@@ -388,22 +374,16 @@ class PlatformDispatcher {
388374
389375 // Called from the engine, via hooks.dart
390376 void _drawFrame () {
391- assert (_debugRenderedViews == null );
392- assert (_debugRenderedViewsBetweenCallbacks != null );
393- assert (() {
394- _debugRenderedViews = _debugRenderedViewsBetweenCallbacks;
395- _debugRenderedViewsBetweenCallbacks = null ;
396- return true ;
397- }());
377+ assert (_renderedViews == null );
378+ assert (_renderedViewsBetweenCallbacks != null );
379+ _renderedViews = _renderedViewsBetweenCallbacks;
380+ _renderedViewsBetweenCallbacks = null ;
398381
399382 _invoke (onDrawFrame, _onDrawFrameZone);
400383
401- assert (_debugRenderedViews != null );
402- assert (_debugRenderedViewsBetweenCallbacks == null );
403- assert (() {
404- _debugRenderedViews = null ;
405- return true ;
406- }());
384+ assert (_renderedViews != null );
385+ assert (_renderedViewsBetweenCallbacks == null );
386+ _renderedViews = null ;
407387 }
408388
409389 /// A callback that is invoked when pointer data is available.
0 commit comments