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

Commit 68016a7

Browse files
committed
Revert "Use last pixel format as default for new layers"
This reverts commit e52e39c.
1 parent 256e0dd commit 68016a7

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

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

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ + (double)displayRefreshRate;
1616
@class FlutterTexture;
1717
@class FlutterDrawable;
1818

19-
static MTLPixelFormat _defaultPixelFormat = MTLPixelFormatBGRA8Unorm;
19+
extern CFTimeInterval display_link_target;
2020

2121
@interface FlutterMetalLayer () {
2222
id<MTLDevice> _preferredDevice;
2323
CGSize _drawableSize;
24-
MTLPixelFormat _pixelFormat;
2524

2625
NSUInteger _nextDrawableId;
2726

@@ -150,6 +149,7 @@ @implementation FlutterMetalLayer
150149

151150
@synthesize preferredDevice = _preferredDevice;
152151
@synthesize device = _device;
152+
@synthesize pixelFormat = _pixelFormat;
153153
@synthesize framebufferOnly = _framebufferOnly;
154154
@synthesize colorspace = _colorspace;
155155
@synthesize wantsExtendedDynamicRangeContent = _wantsExtendedDynamicRangeContent;
@@ -158,7 +158,7 @@ - (instancetype)init {
158158
if (self = [super init]) {
159159
_preferredDevice = MTLCreateSystemDefaultDevice();
160160
self.device = self.preferredDevice;
161-
_pixelFormat = _defaultPixelFormat;
161+
self.pixelFormat = MTLPixelFormatBGRA8Unorm;
162162
_availableTextures = [[NSMutableSet alloc] init];
163163

164164
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onDisplayLink:)];
@@ -172,18 +172,6 @@ - (instancetype)init {
172172
return self;
173173
}
174174

175-
- (MTLPixelFormat)pixelFormat {
176-
return _pixelFormat;
177-
}
178-
179-
- (void)setPixelFormat:(MTLPixelFormat)pixelFormat {
180-
_pixelFormat = pixelFormat;
181-
182-
// FlutterView updates pixel format on it's layer, but the overlay views
183-
// don't - they get correct pixel format right magically.
184-
_defaultPixelFormat = pixelFormat;
185-
}
186-
187175
- (void)dealloc {
188176
[[NSNotificationCenter defaultCenter] removeObserver:self];
189177
}

0 commit comments

Comments
 (0)