| 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.

467 {
468 static BOOL enabled = YES;
469 static BOOL didCheckInfoPlist = NO;
470 if (!didCheckInfoPlist) {
471 didCheckInfoPlist = YES;
472 NSNumber* use_flutter_metal_layer =
473 [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTUseFlutterMetalLayer"];
474 if (use_flutter_metal_layer != nil && ![use_flutter_metal_layer boolValue]) {
475 enabled = NO;
476 }
477 }
478 return enabled;
479 }
+[FlutterMetalLayer enabled]
BOOL enabled()
Definition: FlutterMetalLayer.mm:467

## ◆ nextDrawable

- (id< CAMetalDrawable >) nextDrawable |  |  |

Definition at line 161 of file FlutterMetalLayer.mm.

395 {
396 FlutterTexture* texture = [self nextTexture];
397 if (texture == nil) {
398 return nil;
399 }
400 FlutterDrawable* drawable = [[FlutterDrawable alloc] initWithTexture:texture
401 layer:self
402 drawableId:_nextDrawableId++];
403 return drawable;
404 }
FlutterDrawable
Definition: FlutterMetalLayer.mm:81
FlutterTexture
Definition: FlutterMetalLayer.mm:61

## Property Documentation

## ◆ colorspace

- (CGColorSpaceRef) colorspace
| read write atomic assign

Definition at line 26 of file FlutterMetalLayer.h.

## ◆ device

- (id<MTLDevice>) device
| read write atomic retain

Definition at line 17 of file FlutterMetalLayer.h.

## ◆ drawableSize

- (CGSize) drawableSize
| read write atomic

Definition at line 24 of file FlutterMetalLayer.h.

## ◆ framebufferOnly

- (BOOL) framebufferOnly
| read write atomic

Definition at line 23 of file FlutterMetalLayer.h.

## ◆ pixelFormat

- (MTLPixelFormat) pixelFormat
| read write atomic

Definition at line 22 of file FlutterMetalLayer.h.

## ◆ presentsWithTransaction

- (BOOL) presentsWithTransaction
| read write atomic

Definition at line 25 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