Flutter iOS Embedder
FlutterMetalLayer Class Reference

#import <FlutterMetalLayer.h>

Inheritance diagram for FlutterMetalLayer:

Instance Methods

(nullable id< CAMetalDrawable >) - nextDrawable
 

Class Methods

(BOOL) + enabled
 

Properties

id< MTLDevice > device
 
id< MTLDevice > preferredDevice
 
MTLPixelFormat pixelFormat
 
BOOL framebufferOnly
 
CGSize drawableSize
 
BOOL presentsWithTransaction
 
CGColorSpaceRef colorspace
 
BOOL wantsExtendedDynamicRangeContent
 

Detailed Description

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

Definition at line 12 of file FlutterMetalLayer.h.

Method Documentation

◆ enabled

+ (BOOL) enabled

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

Definition at line 454 of file FlutterMetalLayer.mm.

454  {
455  static BOOL enabled = YES;
456  static BOOL didCheckInfoPlist = NO;
457  if (!didCheckInfoPlist) {
458  didCheckInfoPlist = YES;
459  NSNumber* use_flutter_metal_layer =
460  [[NSBundle mainBundle] objectForInfoDictionaryKey:@"FLTUseFlutterMetalLayer"];
461  if (use_flutter_metal_layer != nil && ![use_flutter_metal_layer boolValue]) {
462  enabled = NO;
463  }
464  }
465  return enabled;
466 }

◆ nextDrawable

- (id< CAMetalDrawable >) nextDrawable

Definition at line 400 of file FlutterMetalLayer.mm.

400  {
401  FlutterTexture* texture = [self nextTexture];
402  if (texture == nil) {
403  return nil;
404  }
405  FlutterDrawable* drawable = [[FlutterDrawable alloc] initWithTexture:texture
406  layer:self
407  drawableId:_nextDrawableId++];
408  return drawable;
409 }

Property Documentation

◆ colorspace

- (CGColorSpaceRef) colorspace
readwriteatomicassign

Definition at line 20 of file FlutterMetalLayer.h.

◆ device

- (id<MTLDevice>) device
readwriteatomicretain

Definition at line 14 of file FlutterMetalLayer.h.

◆ drawableSize

- (CGSize) drawableSize
readwriteatomic

Definition at line 18 of file FlutterMetalLayer.h.

◆ framebufferOnly

- (BOOL) framebufferOnly
readwriteatomic

Definition at line 17 of file FlutterMetalLayer.h.

◆ pixelFormat

- (MTLPixelFormat) pixelFormat
readwriteatomic

Definition at line 16 of file FlutterMetalLayer.h.

◆ preferredDevice

- (id<MTLDevice>) preferredDevice
readatomicassign

Definition at line 15 of file FlutterMetalLayer.h.

◆ presentsWithTransaction

- (BOOL) presentsWithTransaction
readwriteatomic

Definition at line 19 of file FlutterMetalLayer.h.

◆ wantsExtendedDynamicRangeContent

- (BOOL) wantsExtendedDynamicRangeContent
readwriteatomic

Definition at line 21 of file FlutterMetalLayer.h.


The documentation for this class was generated from the following files:
+[FlutterMetalLayer enabled]
BOOL enabled()
Definition: FlutterMetalLayer.mm:454
FlutterDrawable
Definition: FlutterMetalLayer.mm:89
FlutterTexture
Definition: FlutterMetalLayer.mm:59