[iOS] remove clear color hack. (flutter/engine#54451)

Fixes https://github.com/flutter/flutter/issues/125640

This doesn't actually do anything, instead it forces opaque to false. If developers want opaque to be false, they can just set it directly.
This commit is contained in:
Jonah Williams
2024-09-25 21:54:11 -07:00
committed by GitHub
parent fbd02a6108
commit 33f2dcb7eb
2 changed files with 2 additions and 8 deletions

View File

@@ -76,12 +76,6 @@ FLUTTER_ASSERT_ARC
_delegate = delegate;
_isWideGamutEnabled = isWideGamutEnabled;
self.layer.opaque = opaque;
// This line is necessary. CoreAnimation(or UIKit) may take this to do
// something to compute the final frame presented on screen, if we don't set this,
// it will make it take long time for us to take next CAMetalDrawable and will
// cause constant junk during rendering.
self.backgroundColor = UIColor.clearColor;
}
return self;

View File

@@ -51,10 +51,10 @@ FLUTTER_ASSERT_ARC
XCTAssertTrue(delegate.callbackCalled);
}
- (void)testFlutterViewBackgroundColorIsNotNil {
- (void)testFlutterViewBackgroundColorIsNil {
FakeDelegate* delegate = [[FakeDelegate alloc] init];
FlutterView* view = [[FlutterView alloc] initWithDelegate:delegate opaque:NO enableWideGamut:NO];
XCTAssertNotNil(view.backgroundColor);
XCTAssertNil(view.backgroundColor);
}
- (void)testIgnoreWideColorWithoutImpeller {