| Flutter macOS Embedder |

Instance Methods | Properties | List of all members
FlutterSurfaceManager Class Reference

`#import <FlutterSurfaceManager.h>`

Inheritance diagram for FlutterSurfaceManager:

## Instance Methods
(nullable instancetype) | - initWithDevice:commandQueue:layer:delegate:
(nonnull FlutterSurface *) | - surfaceForSize:
(void) | - present:notify:

## Properties
FlutterBackBufferCache * | backBufferCache
NSArray< FlutterSurface * > * | frontSurfaces
NSArray< CALayer * > * | layers

## Detailed Description

FlutterSurfaceManager is responsible for providing and presenting Core Animation render surfaces and managing sublayers.

Owned by `FlutterView`.

Definition at line 41 of file FlutterSurfaceManager.h.

## Method Documentation

## ◆ initWithDevice:commandQueue:layer:delegate:

- (nullable instancetype) initWithDevice: |  | (nonnull id< MTLDevice >) | device
commandQueue: |  | (nonnull id< MTLCommandQueue >) | commandQueue
layer: |  | (nonnull CALayer *) | containingLayer
delegate: |  | (nonnull id< FlutterSurfaceManagerDelegate >) | delegate

Initializes and returns a surface manager that renders to a child layer (referred to as the content layer) of the containing layer.

## ◆ present:notify:

- (void) present: |  | (nonnull NSArray< FlutterSurfacePresentInfo * > *) | surfaces
notify: |  | (nullable dispatch_block_t) | notify

Sets the provided surfaces as contents of FlutterView. Will create, update and remove sublayers as needed.

Must be called on raster thread. This will schedule a commit on the platform thread and block the raster thread until the commit is done. The `notify` block will be invoked on the platform thread and can be used to perform additional work, such as mutating platform views. It is guaranteed be called in the same CATransaction.

Referenced by flutter::testing::TEST().

## ◆ surfaceForSize:

- (FlutterSurface *) surfaceForSize: |  | (CGSize) | size |

Returns a back buffer surface of the given size to which Flutter can render content. A cached surface will be returned if available; otherwise a new one will be created.

Must be called on raster thread.

Definition at line 131 of file FlutterSurfaceManager.mm.

131 :(CGSize)size {
132 FlutterSurface* surface = [_backBufferCache removeSurfaceForSize:size];
133 if (surface == nil) {
134 surface = [[FlutterSurface alloc] initWithSize:size device:_device];
135 }
136 return surface;
137 }

Referenced by flutter::testing::TEST().

## Property Documentation

## ◆ backBufferCache

- (FlutterBackBufferCache*) backBufferCache
| read nonatomic assign

Provided by category FlutterSurfaceManager(Private).

Definition at line 101 of file FlutterSurfaceManager.h.

Referenced by flutter::testing::TEST().

## ◆ frontSurfaces

- (NSArray<FlutterSurface*>*) frontSurfaces
| read nonatomic assign

Provided by category FlutterSurfaceManager(Private).

Definition at line 102 of file FlutterSurfaceManager.h.

Referenced by flutter::testing::TEST().

## ◆ layers

- (NSArray<CALayer*>*) layers
| read nonatomic assign

Provided by category FlutterSurfaceManager(Private).

Definition at line 103 of file FlutterSurfaceManager.h.

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

- shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.h
- shell/platform/darwin/macos/framework/Source/FlutterSurfaceManager.mm

FlutterSurface
Definition: FlutterSurface.h:13