| Flutter iOS Embedder |

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

`#import <FlutterMetalLayer.h>`

Inheritance diagram for FlutterMetalLayer:

## Instance Methods
(id< MTLDevice > preferredDevice) | - API_AVAILABLE
(nullable id< CAMetalDrawable >) | - nextDrawable

## Class Methods
(BOOL) | + enabled

## Properties
id< MTLDevice > | device
MTLPixelFormat | pixelFormat
BOOL | framebufferOnly
CGSize | drawableSize
BOOL | presentsWithTransaction
CGColorSpaceRef | colorspace

## Detailed Description

Drop-in replacement (as far as Flutter is concerned) for CAMetalLayer that can present with transaction from a background thread.

Properties and method declarations must exactly match those in the CAMetalLayer interface declaration.

Definition at line 15 of file FlutterMetalLayer.h.

## Method Documentation

## ◆ API_AVAILABLE

- (id<MTLDevice> preferredDevice) API_AVAILABLE |  | (macos(10.15)) |
|  | (ios(13.0)) |
|  | (tvos(13.0)) |

## ◆ enabled

+ (BOOL) enabled |  |  |

Returns whether the Metal layer is enabled. This is controlled by FLTUseFlutterMetalLayer value in Info.plist.

Definition at line 161 of file FlutterMetalLayer.mm.

443 {
444 static BOOL enabled = YES;
445 static BOOL didCheckInfoPlist = NO;
446 if (!didCheckInfoPlist) {
447 didCheckInfoPlist = YES;
448 NSNumber* use_flutter_metal_layer =
449 [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTUseFlutterMetalLayer"];
450 if (use_flutter_metal_layer != nil && ![use_flutter_metal_layer boolValue]) {
451 enabled = NO;
452 }
453 }
454 return enabled;
455 }
+[FlutterMetalLayer enabled]
BOOL enabled()
Definition: FlutterMetalLayer.mm:443

## ◆ nextDrawable

- (id< CAMetalDrawable >) nextDrawable |  |  |

Definition at line 161 of file FlutterMetalLayer.mm.

389 {
390 FlutterTexture* texture = [self nextTexture];
391 if (texture == nil) {
392 return nil;
393 }
394 FlutterDrawable* drawable = [[FlutterDrawable alloc] initWithTexture:texture
395 layer:self
396 drawableId:_nextDrawableId++];
397 return drawable;
398 }
FlutterDrawable
Definition: FlutterMetalLayer.mm:81
FlutterTexture
Definition: FlutterMetalLayer.mm:61

## Property Documentation

## ◆ colorspace

- (CGColorSpaceRef) colorspace
| readwriteatomicassign

Definition at line 25 of file FlutterMetalLayer.h.

## ◆ device

- (id<MTLDevice>) device
| readwriteatomicretain

Definition at line 17 of file FlutterMetalLayer.h.

## ◆ drawableSize

- (CGSize) drawableSize
| readwriteatomic

Definition at line 23 of file FlutterMetalLayer.h.

## ◆ framebufferOnly

- (BOOL) framebufferOnly
| readwriteatomic

Definition at line 22 of file FlutterMetalLayer.h.

## ◆ pixelFormat

- (MTLPixelFormat) pixelFormat
| readwriteatomic

Definition at line 21 of file FlutterMetalLayer.h.

## ◆ presentsWithTransaction

- (BOOL) presentsWithTransaction
| readwriteatomic

Definition at line 24 of file FlutterMetalLayer.h.

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

- shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.h
- shell/platform/darwin/ios/framework/Source/FlutterMetalLayer.mm