-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
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.