Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Instance Methods | Class Methods | List of all members
FlutterOverlayView Class Reference

#include <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 1 of file FlutterOverlayView.mm.

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

◆ initWithCoder:

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 1 of file FlutterOverlayView.mm.

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

◆ initWithContentsScale:pixelFormat:

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

Definition at line 1 of file FlutterOverlayView.mm.

40 :(CGFloat)contentsScale
41 pixelFormat:(MTLPixelFormat)pixelFormat {
42 self = [self init];
43
44 if ([self.layer isKindOfClass:NSClassFromString(@"CAMetalLayer")]) {
45 self.layer.allowsGroupOpacity = NO;
46 self.layer.contentsScale = contentsScale;
47 self.layer.rasterizationScale = contentsScale;
48#pragma clang diagnostic push
49#pragma clang diagnostic ignored "-Wunguarded-availability-new"
50 CAMetalLayer* layer = (CAMetalLayer*)self.layer;
51#pragma clang diagnostic pop
52 layer.pixelFormat = pixelFormat;
53 if (pixelFormat == MTLPixelFormatRGBA16Float || pixelFormat == MTLPixelFormatBGRA10_XR) {
54 self->_colorSpaceRef = fml::CFRef(CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB));
55 layer.colorspace = self->_colorSpaceRef;
56 }
57 }
58 return self;
59}

◆ initWithFrame:

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE
Initial value:
{

Definition at line 1 of file FlutterOverlayView.mm.

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

◆ layerClass

+ (Class) layerClass
implementation

Definition at line 1 of file FlutterOverlayView.mm.

61 {
62 return [FlutterView layerClass];
63}
Class layerClass()

◆ NS_DESIGNATED_INITIALIZER

- (instancetype) NS_DESIGNATED_INITIALIZER

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