Flutter iOS Embedder
FlutterOverlayView Class Reference

#import <FlutterOverlayView.h>

Inheritance diagram for FlutterOverlayView:

Instance Methods

(instancetype) - initWithFrame:
 
(instancetype) - initWithCoder:
 
(instancetype) - NS_DESIGNATED_INITIALIZER
 
(instancetype) - initWithContentsScale:pixelFormat:
 

Detailed Description

UIViews that are used by |FlutterPlatformViews| to present Flutter rendering on top of system compositor rendering (ex. a web view).

When there is a view composited by the system compositor within a Flutter view hierarchy, instead of rendering into a single render target, Flutter renders into multiple render targets (depending on the number of interleaving levels between Flutter & non-Flutter contents). While the FlutterView contains the backing store for the root render target, the FlutterOverlay view contains the backing stores for the rest. The overlay views also handle touch propagation and the like for touches that occurs either on overlays or otherwise may be intercepted by the platform views.

Definition at line 22 of file FlutterOverlayView.h.

Method Documentation

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 25 of file FlutterOverlayView.mm.

25  :(NSCoder*)aDecoder {
26  NSAssert(NO, @"FlutterOverlayView must init or initWithContentsScale");
27  return nil;
28 }

◆ initWithContentsScale:pixelFormat:

- (instancetype) initWithContentsScale: (CGFloat)  contentsScale
pixelFormat: (MTLPixelFormat)  pixelFormat 

Definition at line 42 of file FlutterOverlayView.mm.

42  :(CGFloat)contentsScale
43  pixelFormat:(MTLPixelFormat)pixelFormat {
44  self = [self init];
45 
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;
58  }
59  }
60  return self;
61 }

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE
Initial value:
{
fml::CFRef<CGColorSpaceRef> _colorSpaceRef

Definition at line 20 of file FlutterOverlayView.mm.

20  :(CGRect)frame {
21  NSAssert(NO, @"FlutterOverlayView must init or initWithContentsScale");
22  return nil;
23 }

◆ NS_DESIGNATED_INITIALIZER

- (instancetype) NS_DESIGNATED_INITIALIZER

The documentation for this class was generated from the following files: