-
Notifications
You must be signed in to change notification settings - Fork 6k
Pushing BackdropFilter Mutator #34355
Changes from all commits
afbb37a
5103d9d
825fbc8
4b5c705
24c077f
e1a817d
d06155c
452a0b7
6b74e7d
455b87f
bc1d19b
4c0f2a5
55d328c
d080e8e
93accab
a9cd101
abc3a0e
86a5913
3897724
d60a016
484957d
929be62
b280266
153df5d
70049ad
3a98c7d
1e6c271
5e94dee
af66748
89cfd8b
042c22e
f9dd08b
9d00f75
f30e262
8b3277f
15fa54f
5891b2e
7c05b74
ca719f3
8d24f64
58b3ce3
7b558e2
b92b17a
0739448
1d0bb6d
b2a2625
aef123c
85e0b4c
235a853
e9d7cb1
a33caa4
3be1bf3
357ec82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ void PlatformViewLayer::Preroll(PrerollContext* context, | |
| context->display_list_enabled); | ||
| context->view_embedder->PrerollCompositeEmbeddedView(view_id_, | ||
| std::move(params)); | ||
| context->view_embedder->PushVisitedPlatformView(view_id_); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Platform view is pushed but nothing ever clears that list, so it will have the same issue as the filters, it slows down rendering until app is unresponsive.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we are fixing it here: #34596 |
||
| } | ||
|
|
||
| void PlatformViewLayer::Paint(PaintContext& context) const { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -318,6 +318,15 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree { | |
| } | ||
| } | ||
|
|
||
| void FlutterPlatformViewsController::PushFilterToVisitedPlatformViews( | ||
| std::shared_ptr<const DlImageFilter> filter) { | ||
| for (int64_t id : visited_platform_views_) { | ||
| EmbeddedViewParams params = current_composition_params_[id]; | ||
| params.PushImageFilter(filter); | ||
| current_composition_params_[id] = params; | ||
| } | ||
|
Comment on lines
+323
to
+327
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should also add a test for this part. Maybe in the XCTests in #34596, instead of adding the filter directly to the stack, we can have a test use this method to add the filter. So let's land #34596 first so we can easily add such tests. CC @emilyabest
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to block this PR to land for now until #34596 is landed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Offline discussion. We will land this PR first and add the final test in a follow up PR |
||
| } | ||
|
|
||
| void FlutterPlatformViewsController::PrerollCompositeEmbeddedView( | ||
| int 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.
The filter is being pushed but never cleared. The platform view gets an ever-increasing number of filters until app is unresponsive.
Uh oh!
There was an error while loading. Please reload this page.
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.
Can you point me to where the filter isn't cleared? IIRC at each frame, the preroll context is re-created, meaning the mutator stack is re-created, so the filters in the stacks are cleared.
I agree with the other comment, the visitedPlatformView list is not cleared.
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.
I ran with a print statement of the number of mutators in vector_ in MutatorsStack::PushBackdropFilter, it was continuously increasing
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.
ah yeah, that's because the visitedPlatformView is increasing and multiple filters are pushed into the same platform view. This is the symptom of not clearing visitedPlatformView list, #34596 will fix it.