Flutter Engine
The Flutter Engine
Instance Methods | Class Methods | List of all members
FlutterOverlayView Class Reference

#import <FlutterOverlayView.h>

Inheritance diagram for FlutterOverlayView:

Instance Methods

(instancetype) - initWithFrame:
 
(instancetype) - initWithCoder:
 
(instancetype) - NS_DESIGNATED_INITIALIZER
 
(instancetype) - initWithContentsScale:pixelFormat:
 
(instancetype) - init [implementation]
 

Class Methods

(Class) + layerClass [implementation]
 

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

◆ init

- (instancetype) init
implementation

Definition at line 12 of file FlutterOverlayView.mm.

30 {
31 self = [super initWithFrame:CGRectZero];
32
33 if (self) {
34 self.layer.opaque = NO;
35 self.userInteractionEnabled = NO;
36 self.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
37 }
38
39 return self;
40}

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 12 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 12 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:
{

Definition at line 12 of file FlutterOverlayView.mm.

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

◆ layerClass

+ (Class) layerClass
implementation

Definition at line 12 of file FlutterOverlayView.mm.

63 {
64 return [FlutterView layerClass];
65}
Class layerClass()
Definition: FlutterView.mm:137

◆ NS_DESIGNATED_INITIALIZER

- (instancetype) NS_DESIGNATED_INITIALIZER

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