5#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterOverlayView.h"
7#include <CoreGraphics/CGColorSpace.h>
9#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterView.h"
21 NSAssert(NO,
@"FlutterOverlayView must init or initWithContentsScale");
26 NSAssert(NO,
@"FlutterOverlayView must init or initWithContentsScale");
31 self = [
super initWithFrame:CGRectZero];
34 self.layer.opaque = NO;
35 self.userInteractionEnabled = NO;
36 self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
42- (instancetype)initWithContentsScale:(CGFloat)contentsScale
43 pixelFormat:(MTLPixelFormat)pixelFormat {
46 if ([
self.layer isKindOfClass:NSClassFromString(
@"CAMetalLayer")]) {
47 self.layer.allowsGroupOpacity = NO;
48 self.layer.contentsScale = contentsScale;
49 self.layer.rasterizationScale = contentsScale;
50#pragma clang diagnostic push
51#pragma clang diagnostic ignored "-Wunguarded-availability-new"
52 CAMetalLayer* layer = (CAMetalLayer*)
self.layer;
53#pragma clang diagnostic
pop
54 layer.pixelFormat = pixelFormat;
55 if (pixelFormat == MTLPixelFormatRGBA16Float || pixelFormat == MTLPixelFormatBGRA10_XR) {
56 self->_colorSpaceRef =
fml::CFRef(CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB));
57 layer.colorspace =
self->_colorSpaceRef;
static std::function< void(void)> pop(std::deque< std::function< void(void)> > *list)
instancetype initWithFrame
instancetype initWithCoder