This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Pushing BackdropFilter Mutator #34355
Merged
Merged
Changes from 12 commits
Commits
Show all changes
53 commits
Select commit
Hold shift + click to select a range
afbb37a
Testing Preroll/Paint
JTKryptic 5103d9d
Pushed opacity to platform view stack / Background Filter Proto 1
JTKryptic 825fbc8
Create Backdrop Filter Mutator
JTKryptic 4b5c705
Merge branch 'diff' into backdrop_filter_testing
JTKryptic 24c077f
Removed Logs
JTKryptic e1a817d
Tests for PushFilter
JTKryptic d06155c
Backdrop Filter Mutator
JTKryptic 452a0b7
Merge branch 'diff' into backdrop_filter_testing
JTKryptic 6b74e7d
Formatting
JTKryptic 455b87f
Merge branch 'backdrop_filter_testing'
JTKryptic bc1d19b
Format files
JTKryptic 4c0f2a5
Merge branch 'main' into backdrop_filter_testing
JTKryptic 55d328c
Delete backdrop_filter_diff
JTKryptic d080e8e
Code cleanup
JTKryptic 93accab
Updating to DlImageFilter and code cleanup
JTKryptic a9cd101
Formatting
JTKryptic abc3a0e
bug fix
JTKryptic 86a5913
Fix
JTKryptic 3897724
Merge branch 'main' into backdrop_filter_testing
JTKryptic d60a016
Enum style guide fix
JTKryptic 484957d
Cleanup
JTKryptic 929be62
Cleanup and Tests
JTKryptic b280266
format
JTKryptic 153df5d
format
JTKryptic 70049ad
Memory leak failure fix
JTKryptic 3a98c7d
format
JTKryptic 1e6c271
Merge upstream_main into backdrop_filter_testing
JTKryptic 5e94dee
Remove platform view flag
JTKryptic af66748
format
JTKryptic 89cfd8b
nit
JTKryptic 042c22e
Merge branch 'upstream_main' into backdrop_filter_testing
JTKryptic f9dd08b
test fix
JTKryptic 9d00f75
format
JTKryptic f30e262
backdrop filter unit tests
JTKryptic 8b3277f
shell cleaning
JTKryptic 15fa54f
Merge branch 'upstream_main' into backdrop_filter_testing
JTKryptic 5891b2e
formatting
JTKryptic 7c05b74
Update ios_external_view_embedder.h
JTKryptic ca719f3
Update ios_external_view_embedder.mm
JTKryptic 8d24f64
format
JTKryptic 58b3ce3
PR comment changes
JTKryptic 7b558e2
Update embedded_views.h
JTKryptic b92b17a
Merge branch 'upstream_main' into backdrop_filter_testing
JTKryptic 0739448
Merge branch 'main' into backdrop_filter_testing
JTKryptic 1d0bb6d
Update embedded_views.h
JTKryptic b2a2625
Update shell_test_external_view_embedder.cc
JTKryptic aef123c
Update shell_test_external_view_embedder.cc
JTKryptic 85e0b4c
Update shell_test_external_view_embedder.cc
JTKryptic 235a853
Update shell_test_external_view_embedder.h
JTKryptic e9d7cb1
test fix
JTKryptic a33caa4
fixes
JTKryptic 3be1bf3
test fix
JTKryptic 357ec82
test fix 3
JTKryptic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| diff --git a/flow/embedded_views.h b/flow/embedded_views.h | ||
| index 7a5a34f330..76b002befd 100644 | ||
| --- a/flow/embedded_views.h | ||
| +++ b/flow/embedded_views.h | ||
| @@ -345,6 +345,8 @@ class ExternalViewEmbedder { | ||
| // 'EndFrame', otherwise returns false. | ||
| bool GetUsedThisFrame() const { return used_this_frame_; } | ||
|
|
||
| + void PushMutator() {} | ||
| + | ||
| private: | ||
| bool used_this_frame_ = false; | ||
|
|
||
| diff --git a/flow/layers/backdrop_filter_layer.cc b/flow/layers/backdrop_filter_layer.cc | ||
| index 8e8ef2628a..b059e427c3 100644 | ||
| --- a/flow/layers/backdrop_filter_layer.cc | ||
| +++ b/flow/layers/backdrop_filter_layer.cc | ||
| @@ -43,6 +43,10 @@ void BackdropFilterLayer::Preroll(PrerollContext* context, | ||
| Layer::AutoPrerollSaveLayerState save = | ||
| Layer::AutoPrerollSaveLayerState::Create(context, true, bool(filter_)); | ||
| SkRect child_paint_bounds = SkRect::MakeEmpty(); | ||
| + auto visited_platform_views = context->view_embedder->GetVisitedPlatformViews(); | ||
| + for (id in visited_platform_views) { | ||
| + context->view_embedder->ApplyMutator(id, alpha); | ||
| + } | ||
| PrerollChildren(context, matrix, &child_paint_bounds); | ||
| child_paint_bounds.join(context->cull_rect); | ||
| set_paint_bounds(child_paint_bounds); | ||
| diff --git a/flow/layers/platform_view_layer.cc b/flow/layers/platform_view_layer.cc | ||
| index 285db390cc..63b7827cf9 100644 | ||
| --- a/flow/layers/platform_view_layer.cc | ||
| +++ b/flow/layers/platform_view_layer.cc | ||
| @@ -28,6 +28,7 @@ void PlatformViewLayer::Preroll(PrerollContext* context, | ||
| context->mutators_stack); | ||
| context->view_embedder->PrerollCompositeEmbeddedView(view_id_, | ||
| std::move(params)); | ||
| + context->view_embedder->PushVisitedPlatformView(view_id_); | ||
| } | ||
|
|
||
| void PlatformViewLayer::Paint(PaintContext& context) const { | ||
| diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm | ||
| index e5325aee85..a6992cca3f 100644 | ||
| --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm | ||
| +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm | ||
| @@ -319,6 +319,11 @@ void FlutterPlatformViewsController::EndFrame( | ||
| } | ||
| } | ||
|
|
||
| +void FlutterPlatformViewsController::PushMutator(flutter::Mutator mutator, int64_t platform_view_id) { | ||
| + EmbeddedViewParams params = current_composition_params_[platform_view_id]; | ||
| + params.mutatorsStack().PushOpacity(20); | ||
| +} | ||
| + | ||
| void FlutterPlatformViewsController::PrerollCompositeEmbeddedView( | ||
| int view_id, | ||
| std::unique_ptr<EmbeddedViewParams> params) { | ||
| diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h | ||
| index fde21d23e2..522b847ef4 100644 | ||
| --- a/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h | ||
| +++ b/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews_Internal.h | ||
| @@ -184,6 +184,8 @@ class FlutterPlatformViewsController { | ||
| // responder. Returns -1 if no such platform view is found. | ||
| long FindFirstResponderPlatformViewId(); | ||
|
|
||
| + void PushMutator(flutter::Mutator mutator, int64_t platform_view_id); | ||
| + | ||
| private: | ||
| static const size_t kMaxLayerAllocations = 2; | ||
|
|
||
| diff --git a/shell/platform/darwin/ios/ios_external_view_embedder.h b/shell/platform/darwin/ios/ios_external_view_embedder.h | ||
| index 6c023d1b79..da160dd023 100644 | ||
| --- a/shell/platform/darwin/ios/ios_external_view_embedder.h | ||
| +++ b/shell/platform/darwin/ios/ios_external_view_embedder.h | ||
| @@ -64,6 +64,8 @@ class IOSExternalViewEmbedder : public ExternalViewEmbedder { | ||
| // |ExternalViewEmbedder| | ||
| bool SupportsDynamicThreadMerging() override; | ||
|
|
||
| + void PushMutator() override; | ||
| + | ||
| FML_DISALLOW_COPY_AND_ASSIGN(IOSExternalViewEmbedder); | ||
| }; | ||
|
|
||
| diff --git a/shell/platform/darwin/ios/ios_external_view_embedder.mm b/shell/platform/darwin/ios/ios_external_view_embedder.mm | ||
| index 1323fa4c2f..edd4a3adcd 100644 | ||
| --- a/shell/platform/darwin/ios/ios_external_view_embedder.mm | ||
| +++ b/shell/platform/darwin/ios/ios_external_view_embedder.mm | ||
| @@ -92,4 +92,8 @@ bool IOSExternalViewEmbedder::SupportsDynamicThreadMerging() { | ||
| return true; | ||
| } | ||
|
|
||
| +void PushMutator(int alpha, int view_id) { | ||
| + platform_views_controller_->PushMutator(alpha, view_id); | ||
| +} | ||
| + | ||
| } // namespace flutter | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ void PlatformViewLayer::Preroll(PrerollContext* context, | |
| context->mutators_stack); | ||
| 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 { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.