@@ -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