Skip to content

Enforce the rendering rule #137073

@dkwingsmt

Description

@dkwingsmt

The rendering rule is a calling convention documented in FlutterView.Render:

  /// This function must be called within the scope of the
  /// [PlatformDispatcher.onBeginFrame] or [PlatformDispatcher.onDrawFrame]
  /// callbacks being invoked.
  ///
  /// If this function is called a second time during a single
  /// [PlatformDispatcher.onBeginFrame]/[PlatformDispatcher.onDrawFrame]
  /// callback sequence or called outside the scope of those callbacks, the call
  /// will be ignored.

This rule is very important to implementing multi-view without having to introduce new APIs. However, historically these illegal calls were not ignored and could cause unintended effects that many things were actually relying on.

With multiple PRs, we managed to make it closer to removing violations, but we still haven't fully enforced it.

The current status:

  • On debug build, illegal calls are caught and skipped by the PlatformDispatcher.
  • On release build, illegal calls are caught and skipped by the Animator.

We should:

  • Unify the behavior of the debug build and the release build.
  • Make both behavior assert on (and skip) illegal calls.

Obstacle:

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: multi windowIssues related to multi window supportc: proposalA detailed proposal for a change to Flutterteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions