Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit fc6c852

Browse files
author
Jonah Williams
authored
[iOS] remove clear color hack. (#54451)
Fixes flutter/flutter#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.
1 parent 3719454 commit fc6c852

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

shell/platform/darwin/ios/framework/Source/FlutterView.mm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,6 @@ - (instancetype)initWithDelegate:(id<FlutterViewEngineDelegate>)delegate
7676
_delegate = delegate;
7777
_isWideGamutEnabled = isWideGamutEnabled;
7878
self.layer.opaque = opaque;
79-
80-
// This line is necessary. CoreAnimation(or UIKit) may take this to do
81-
// something to compute the final frame presented on screen, if we don't set this,
82-
// it will make it take long time for us to take next CAMetalDrawable and will
83-
// cause constant junk during rendering.
84-
self.backgroundColor = UIColor.clearColor;
8579
}
8680

8781
return self;

shell/platform/darwin/ios/framework/Source/FlutterViewTest.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ - (void)testFlutterViewEnableSemanticsWhenIsAccessibilityElementIsCalled {
5151
XCTAssertTrue(delegate.callbackCalled);
5252
}
5353

54-
- (void)testFlutterViewBackgroundColorIsNotNil {
54+
- (void)testFlutterViewBackgroundColorIsNil {
5555
FakeDelegate* delegate = [[FakeDelegate alloc] init];
5656
FlutterView* view = [[FlutterView alloc] initWithDelegate:delegate opaque:NO enableWideGamut:NO];
57-
XCTAssertNotNil(view.backgroundColor);
57+
XCTAssertNil(view.backgroundColor);
5858
}
5959

6060
- (void)testIgnoreWideColorWithoutImpeller {

0 commit comments

Comments
 (0)