Flutter Engine
FlutterView Class Reference

#import <FlutterView.h>

Inheritance diagram for FlutterView:

Instance Methods

(instancetype) - NS_UNAVAILABLE
 
(instancetype) - initWithFrame:
 
(instancetype) - initWithCoder:
 
(instancetype) - initWithDelegate:opaque:
 
(nullable instancetype) - initWithMTLDevice:commandQueue:reshapeListener:
 
(nullable instancetype) - initWithFrame:mainContext:reshapeListener:
 
(nullable instancetype) - initWithMainContext:reshapeListener:
 
(nullable instancetype) - initWithFrame:pixelFormat:
 
(nonnull instancetype) - initWithFrame:
 
(nullable instancetype) - initWithCoder:
 
(nonnull instancetype) - NS_UNAVAILABLE
 
(void) - present
 
(nonnull FlutterRenderBackingStore *) - backingStoreForSize:
 
(void) - shutdown
 

Class Methods

(instancetype) + NS_UNAVAILABLE
 

Properties

BOOL forceSoftwareRendering
 

Detailed Description

View capable of acting as a rendering target and input source for the Flutter engine.

Definition at line 36 of file FlutterView.h.

Method Documentation

◆ backingStoreForSize:()

- (FlutterRenderBackingStore *) backingStoreForSize: (CGSize)  size

Ensures that a backing store with requested size exists and returns the descriptor. Expected to be called on raster thread.

Definition at line 64 of file FlutterView.mm.

References fml::size().

64  :(CGSize)size {
65  if ([_resizeSynchronizer shouldEnsureSurfaceForSize:size]) {
66  [_resizableBackingStoreProvider onBackingStoreResized:size];
67  }
68  return [_resizableBackingStoreProvider backingStore];
69 }
constexpr std::size_t size(T(&array)[N])
Definition: size.h:13

◆ initWithCoder:() [1/2]

- (instancetype) initWithCoder: (NSCoder*)  NS_UNAVAILABLE

Definition at line 36 of file FlutterView.mm.

36  :(NSCoder*)aDecoder {
37  @throw([NSException exceptionWithName:@"FlutterView must initWithDelegate"
38  reason:nil
39  userInfo:nil]);
40 }

◆ initWithCoder:() [2/2]

- (nullable instancetype) initWithCoder: (nonnull NSCoder *)  NS_UNAVAILABLE

◆ initWithDelegate:opaque:()

- (instancetype) initWithDelegate: (id<FlutterViewEngineDelegate>)  delegate
opaque: (BOOL NS_DESIGNATED_INITIALIZER 

Definition at line 42 of file FlutterView.mm.

42  :(id<FlutterViewEngineDelegate>)delegate opaque:(BOOL)opaque {
43  if (delegate == nil) {
44  NSLog(@"FlutterView delegate was nil.");
45  [self release];
46  return nil;
47  }
48 
49  self = [super initWithFrame:CGRectNull];
50 
51  if (self) {
52  _delegate = delegate;
53  self.layer.opaque = opaque;
54  }
55 
56  return self;
57 }
int BOOL
Definition: windows_types.h:37

◆ initWithFrame:() [1/2]

- (instancetype) initWithFrame: (CGRect)  NS_UNAVAILABLE

Definition at line 30 of file FlutterView.mm.

30  :(CGRect)frame {
31  @throw([NSException exceptionWithName:@"FlutterView must initWithDelegate"
32  reason:nil
33  userInfo:nil]);
34 }

◆ initWithFrame:() [2/2]

- (nonnull instancetype) initWithFrame: (NSRect)  NS_UNAVAILABLE

◆ initWithFrame:mainContext:reshapeListener:()

- (nullable instancetype) initWithFrame: (NSRect)  frame
mainContext: (nonnull NSOpenGLContext *)  mainContext
reshapeListener: (nonnull id< FlutterViewReshapeListener >)  NS_DESIGNATED_INITIALIZER 

◆ initWithFrame:pixelFormat:()

- (nullable instancetype) initWithFrame: (NSRect)  frameRect
pixelFormat: (nullable NSOpenGLPixelFormat *)  NS_UNAVAILABLE 

◆ initWithMainContext:reshapeListener:()

- (nullable instancetype) initWithMainContext: (nonnull NSOpenGLContext *)  mainContext
reshapeListener: (nonnull id< FlutterViewReshapeListener >)  reshapeListener 

◆ initWithMTLDevice:commandQueue:reshapeListener:()

- (nullable instancetype) initWithMTLDevice: (nonnull id< MTLDevice >)  device
commandQueue: (nonnull id< MTLCommandQueue >)  commandQueue
reshapeListener: (nonnull id< FlutterViewReshapeListener >)  NS_DESIGNATED_INITIALIZER 

Initialize a FlutterView that will be rendered to using Metal rendering apis.

◆ NS_UNAVAILABLE() [1/3]

+ (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE() [2/3]

- (instancetype) NS_UNAVAILABLE

◆ NS_UNAVAILABLE() [3/3]

- (nonnull instancetype) NS_UNAVAILABLE

◆ present()

- (void) present

Flushes the OpenGL context and flips the surfaces. Expected to be called on raster thread.

Definition at line 71 of file FlutterView.mm.

71  {
72  [_resizeSynchronizer requestCommit];
73 }

◆ shutdown()

- (void) shutdown

Must be called when shutting down. Unblocks raster thread and prevents any further synchronization.

Definition at line 111 of file FlutterView.mm.

111  {
112  [_resizeSynchronizer shutdown];
113 }

Property Documentation

◆ forceSoftwareRendering

- (BOOL) forceSoftwareRendering
readwritenonatomicassign

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