Skip to content

Expose nodes needing layout or paint from PipelineOwner #166147

Closed

Description

@emerssso

Use case

I'm working on a "session replay" package, where we periodically scan the render tree, redact images and text, and serialize the approximate appearance so that a user session can be later viewed by a product team (as part of user research or similar).

One optimization I'd like to make is to skip subtrees where nothing has changed since our last scan, and reuse the previous serialization. To do this, I would need to know which render objects have been invalidated (roughly, marked for painting or layout) since my last scan.

My team previously proposed https://flutter.dev/go/ondirtycallbacks to solve this. Discussion on that doc led to a decision that a better solution would be to expose PipelineOwner._nodesNeedingLayout and PipelineOwner._nodesNeedingPaint to subclasses, as this solves the same problem in a more performant manner.

Proposal

Add public @protected getters for the existing PipelineOwner._nodesNeedingLayout and PipelineOwner._nodesNeedingPaint so that subclasses may access these fields and use them as part of feature sets which augment the rendering pipeline.

I'll put together a PR for this change.

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Mar 28, 2025
  2. chunhtai commented on Apr 1, 2025

    @chunhtai
    Contributor

    closed via #166148

  3. github-actions commented on Apr 15, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.team-frameworkOwned by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions