Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
021480d
Resolving merge conflicts.
emilyabest Jun 10, 2022
5027753
Removed trailing whitespace
emilyabest Jul 15, 2022
24731fa
Removed conflict code. Initial attempt with backdrop filter case.
emilyabest Jul 15, 2022
83b6607
Removed duplicate test
emilyabest Jul 18, 2022
fb0684c
Reverted code to pass the unit tests. Prepared method calls for mergi…
emilyabest Jul 19, 2022
31567f4
Ran whitespace check
emilyabest Jul 19, 2022
2bca987
Bringing back old checks.
emilyabest Jul 19, 2022
e830e4a
Updated code to plug into Javon's PR. Started unit tests for integrat…
emilyabest Jul 19, 2022
c881e11
Saving applyBackdropFilterWithRadius method for reference.
emilyabest Jul 20, 2022
81d2d71
Removed applyBackdropFilterWithRadius method. This is the new startin…
emilyabest Jul 20, 2022
bc2e1b1
Updated unit tests to use applyBackdropFilter method
emilyabest Jul 21, 2022
ff81803
Ran clang checks
emilyabest Jul 21, 2022
359a10d
First implementation to allow multiple backdrop filters. Also reorgan…
emilyabest Jul 21, 2022
cfd473d
Fixed BAD ACCESS error with private instance variable. Prepped for gi…
emilyabest Jul 22, 2022
ac3d4cf
Ran formatting checks
emilyabest Jul 22, 2022
c501a80
Condensed applyBackdropFilter method
emilyabest Jul 25, 2022
b4c64b6
Updated spacing.
emilyabest Jul 25, 2022
0f147e9
Formatted code
emilyabest Jul 25, 2022
604113e
Quick fix for failing applyBackdropFilters unit test. Started PR comm…
emilyabest Jul 27, 2022
ade2908
Added unit tests for non-DlImageBlurFilters. Made activeGaussianFilte…
emilyabest Jul 27, 2022
6a1e014
Formatting checks
emilyabest Jul 27, 2022
e07cb72
Minor formatting changes
emilyabest Jul 28, 2022
d9bcea9
Minor changes for visual testing.
emilyabest Jul 28, 2022
4ae563b
Ran formatting checks
emilyabest Jul 28, 2022
8e48100
Merge branch 'main' into BackdropView
emilyabest Jul 28, 2022
b18c2ad
Updated code to work with Chris' PR
emilyabest Aug 1, 2022
732c94d
Formatted code
emilyabest Aug 1, 2022
d6066ec
Resolved memory leak failure. Commented pass by reference alternative.
emilyabest Aug 2, 2022
2450016
Reorganized extraction method to use a for loop
emilyabest Aug 2, 2022
995fd57
Formatted code. Previous commit also updates API checks
emilyabest Aug 2, 2022
20a7d8f
Added unit test for invalid UIVEV API
emilyabest Aug 3, 2022
d81676f
Formatting check
emilyabest Aug 3, 2022
4e9da14
Implemented Chris' last comments, reverted back to original check to …
emilyabest Aug 4, 2022
2bdaec3
Formatting checks
emilyabest Aug 4, 2022
dc064ed
Removed typo
emilyabest Aug 4, 2022
beb4090
Formatting checks
emilyabest Aug 4, 2022
5599649
Moved blurEffectView release. Working on GitHub error.
emilyabest Aug 9, 2022
def8905
Formatting checks
emilyabest Aug 9, 2022
d010037
Adding gaussianFilter copies
emilyabest Aug 9, 2022
029d7cc
Formatting checks
emilyabest Aug 9, 2022
673b641
Simplified applyBackdropBlurFilter method
emilyabest Aug 10, 2022
aeef63e
Formatting checks
emilyabest Aug 10, 2022
b434756
Moved blurEffectView release to dealloc. Simplified while loops to cl…
emilyabest Aug 10, 2022
9429015
Simplified applyBackdropBlurFilters method
emilyabest Aug 10, 2022
cfea8e9
Trying a different init method for newGaussianFilters.
emilyabest Aug 10, 2022
3ed695d
Added autorelease after copying _gaussianFilter
emilyabest Aug 11, 2022
c4ab9cb
Merge branch 'main' into BackdropViewPreRebase
emilyabest Aug 12, 2022
a1ca917
review feedbacks
Aug 13, 2022
ee25e17
remove TODOs
Aug 18, 2022
92cc72b
fixes
Aug 18, 2022
1dca0dd
update golden
Aug 18, 2022
0702129
Merge branch 'main' into BackdropView
Aug 22, 2022
c810c40
Revert "Revert "Pushing BackdropFilter Mutator (#34355)" (#35543)"
Aug 22, 2022
a043cca
merge main
Aug 29, 2022
fd24904
update golden
Aug 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
@end

namespace flutter {
// Becomes NO if Apple's API changes and blurred backdrop filters cannot be applied.
BOOL canApplyBlurBackdrop = YES;
// int changingBlurRadius = 0; // TODO EMILY part of visual tests. delete before landing PR

std::shared_ptr<FlutterPlatformViewLayer> FlutterPlatformViewLayerPool::GetLayer(
GrDirectContext* gr_context,
Expand Down Expand Up @@ -414,12 +417,35 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
CGRectGetWidth(flutter_view.bounds),
CGRectGetHeight(flutter_view.bounds))] autorelease];

NSMutableArray* blurRadii = [[[NSMutableArray alloc] init] autorelease];

// TODO EMILY: this line is for visual simulator tests, delete before landing PR
// int numFilters = 0;

auto iter = mutators_stack.Begin();
while (iter != mutators_stack.End()) {
switch ((*iter)->GetType()) {
case kTransform: {
CATransform3D transform = GetCATransform3DFromSkMatrix((*iter)->GetMatrix());
finalTransform = CATransform3DConcat(transform, finalTransform);

// TODO EMILY: these lines are for visual simulator tests, delete before landing
// PR
// if(numFilters < 1) {
// flutter::DlBlurImageFilter filter =
// flutter::DlBlurImageFilter(changingBlurRadius,
// changingBlurRadius, flutter::DlTileMode::kDecal);
//
// NSNumber* blurRadius =
// @(filter.asBlur()->sigma_x());
// [blurRadii addObject:blurRadius];
//
// numFilters++;
// FML_DLOG(ERROR) << "****checkpoint***" <<
// changingBlurRadius;
//
// changingBlurRadius++;
// }
break;
}
case kClipRect:
Expand All @@ -434,11 +460,25 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
case kOpacity:
embedded_view.alpha = (*iter)->GetAlphaFloat() * embedded_view.alpha;
break;
case kBackdropFilter:
case kBackdropFilter: {
// We only support DlBlurImageFilter for BackdropFilter.
if ((*iter)->GetFilter().asBlur() && canApplyBlurBackdrop) {
// sigma_x is arbitrarily chosen as the radius value because Quartz sets
// sigma_x and sigma_y equal to each other. DlBlurImageFilter's Tile Mode
// is not supported in Quartz's gaussianBlur CAFilter, so it is not used
// to blur the PlatformView.
[blurRadii addObject:@((*iter)->GetFilter().asBlur()->sigma_x())];
}
break;
}
}
++iter;
}

if (canApplyBlurBackdrop) {
Comment thread
emilyabest marked this conversation as resolved.
canApplyBlurBackdrop = [clipView applyBlurBackdropFilters:blurRadii];
}

// Reverse the offset of the clipView.
// The clipView's frame includes the final translate of the final transform matrix.
// So we need to revese this translate so the platform view can layout at the correct offset.
Expand Down
Loading