-
Notifications
You must be signed in to change notification settings - Fork 6k
Move the mutators stack handling to preroll #9651
Conversation
iskakaushik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some minor changes. looks good overall.
| return; | ||
| } | ||
| current_composition_params_[view_id] = EmbeddedViewParams(*params.get()); | ||
| views_need_recomposite.insert(view_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: better name would be view_needs_recomposition_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, kept is as views_need_recomposition_ since it is a set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe views_to_recomposite_?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| std::vector<int64_t> active_composition_order_; | ||
|
|
||
| // Only compoiste platform views in this set. | ||
| std::unordered_set<int64_t> views_need_recomposite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private variable, end with underscore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return; | ||
| } | ||
| context->view_embedder->PrerollCompositeEmbeddedView(view_id_); | ||
| std::unique_ptr<EmbeddedViewParams> params = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't need to be a unique_ptr. Just make this a stack variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a refactoring just landed in a previous PR. #9640
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with @iskakaushik's comment
| std::vector<int64_t> active_composition_order_; | ||
|
|
||
| // Only compoiste platform views in this set. | ||
| std::unordered_set<int64_t> views_need_recomposite; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return; | ||
| } | ||
| context->view_embedder->PrerollCompositeEmbeddedView(view_id_); | ||
| std::unique_ptr<EmbeddedViewParams> params = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a refactoring just landed in a previous PR. #9640
| return; | ||
| } | ||
| current_composition_params_[view_id] = EmbeddedViewParams(*params.get()); | ||
| views_need_recomposite.insert(view_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, kept is as views_need_recomposition_ since it is a set.
|
LGTM |
amirh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo nits
flow/layers/clip_path_layer.cc
Outdated
| void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { | ||
| SkRect previous_cull_rect = context->cull_rect; | ||
| SkRect clip_path_bounds = clip_path_.getBounds(); | ||
| context->mutators_stack.pushClipPath(clip_path_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: move these inside the condition (if the clip is empty we're not painting the subtree), it's going to have the same effect only that the intention is more explicit.
Same for the other clip layers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return; | ||
| } | ||
| current_composition_params_[view_id] = EmbeddedViewParams(*params.get()); | ||
| views_need_recomposite.insert(view_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe views_to_recomposite_?
cyanglaz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with @amirh's comment
flow/layers/clip_path_layer.cc
Outdated
| void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) { | ||
| SkRect previous_cull_rect = context->cull_rect; | ||
| SkRect clip_path_bounds = clip_path_.getBounds(); | ||
| context->mutators_stack.pushClipPath(clip_path_); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
| return; | ||
| } | ||
| current_composition_params_[view_id] = EmbeddedViewParams(*params.get()); | ||
| views_need_recomposite.insert(view_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
flutter/engine@7d3e722...3c51a7b git log 7d3e722..3c51a7b --no-merges --oneline 3c51a7b Roll src/third_party/skia 11eb847a2080..857c9f955edb (2 commits) (flutter/engine#9676) 7f828dd Raster now returns an enum rather than boolean (flutter/engine#9661) 11b6afe Roll src/third_party/dart 67ab3be10d...b5aeaa6796 (flutter/engine#9675) 3c4dbe2 Revert " Roll src/third_party/dart 67ab3be10d...43891316ca (#9670)" (flutter/engine#9673) 5e596f2 Roll src/third_party/dart 67ab3be10d...43891316ca (flutter/engine#9670) 46a2239 Roll src/third_party/skia 5b52c52141ac..11eb847a2080 (6 commits) (flutter/engine#9671) b84f89b Allow embedders to add callbacks for responses to platform messages from the framework. (flutter/engine#9655) 8dac2e9 Begin separating macOS engine from view controller (flutter/engine#9654) d3616c7 Roll src/third_party/skia 0e0113dcbd9a..5b52c52141ac (8 commits) (flutter/engine#9665) cea2c36 Mutators Stack refactoring (flutter/engine#9663) 6a8782f Roll src/third_party/skia 93eeff578b08..0e0113dcbd9a (9 commits) (flutter/engine#9662) 791143f ExternalViewEmbedder can CancelFrame after pre-roll (flutter/engine#9660) d637f29 External view embedder can tell if embedded views have mutated (flutter/engine#9653) ceee3d7 Roll src/third_party/skia 38ae3f42fec1..93eeff578b08 (1 commits) (flutter/engine#9659) d757290 Roll src/third_party/skia febc162c7898..38ae3f42fec1 (3 commits) (flutter/engine#9658) 58133ab Roll src/third_party/skia 3de5c6388142..febc162c7898 (2 commits) (flutter/engine#9657) 29342dd Roll src/third_party/skia 1e2cb444e0c1..3de5c6388142 (8 commits) (flutter/engine#9656) b547356 Pipeline allows continuations that can produce to front (flutter/engine#9652) 8306ee6 Move the mutators stack handling to preroll (flutter/engine#9651) 511b9f2 Roll src/third_party/skia 215ff3325230..1e2cb444e0c1 (12 commits) (flutter/engine#9650) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (jsimmons@google.com), and stop the roller if necessary.
flutter/engine@7d3e722...3c51a7b git log 7d3e722..3c51a7b --no-merges --oneline 3c51a7b Roll src/third_party/skia 11eb847a2080..857c9f955edb (2 commits) (flutter/engine#9676) 7f828dd Raster now returns an enum rather than boolean (flutter/engine#9661) 11b6afe Roll src/third_party/dart 67ab3be10d...b5aeaa6796 (flutter/engine#9675) 3c4dbe2 Revert &flutter#34; Roll src/third_party/dart 67ab3be10d...43891316ca (flutter#9670)&flutter#34; (flutter/engine#9673) 5e596f2 Roll src/third_party/dart 67ab3be10d...43891316ca (flutter/engine#9670) 46a2239 Roll src/third_party/skia 5b52c52141ac..11eb847a2080 (6 commits) (flutter/engine#9671) b84f89b Allow embedders to add callbacks for responses to platform messages from the framework. (flutter/engine#9655) 8dac2e9 Begin separating macOS engine from view controller (flutter/engine#9654) d3616c7 Roll src/third_party/skia 0e0113dcbd9a..5b52c52141ac (8 commits) (flutter/engine#9665) cea2c36 Mutators Stack refactoring (flutter/engine#9663) 6a8782f Roll src/third_party/skia 93eeff578b08..0e0113dcbd9a (9 commits) (flutter/engine#9662) 791143f ExternalViewEmbedder can CancelFrame after pre-roll (flutter/engine#9660) d637f29 External view embedder can tell if embedded views have mutated (flutter/engine#9653) ceee3d7 Roll src/third_party/skia 38ae3f42fec1..93eeff578b08 (1 commits) (flutter/engine#9659) d757290 Roll src/third_party/skia febc162c7898..38ae3f42fec1 (3 commits) (flutter/engine#9658) 58133ab Roll src/third_party/skia 3de5c6388142..febc162c7898 (2 commits) (flutter/engine#9657) 29342dd Roll src/third_party/skia 1e2cb444e0c1..3de5c6388142 (8 commits) (flutter/engine#9656) b547356 Pipeline allows continuations that can produce to front (flutter/engine#9652) 8306ee6 Move the mutators stack handling to preroll (flutter/engine#9651) 511b9f2 Roll src/third_party/skia 215ff3325230..1e2cb444e0c1 (12 commits) (flutter/engine#9650) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff (jsimmons@google.com), and stop the roller if necessary.
Move the mutator stack handling to tree preroll. And the platform view is going to decide if it should composite or not, and set a flag.
In paint (Composite), based on the flag, we composite with the cached embedded view params.