Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
FlutterMetalLayer.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERMETALLAYER_H_
6#define FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERMETALLAYER_H_
7
8#import <QuartzCore/QuartzCore.h>
9
10/// Drop-in replacement (as far as Flutter is concerned) for CAMetalLayer
11/// that can present with transaction from a background thread.
12@interface FlutterMetalLayer : CALayer
13
14@property(nullable, retain) id<MTLDevice> device;
15@property(nullable, readonly) id<MTLDevice> preferredDevice;
16@property MTLPixelFormat pixelFormat;
18@property CGSize drawableSize;
20@property(nullable) CGColorSpaceRef colorspace;
22
23- (nullable id<CAMetalDrawable>)nextDrawable;
24
25/// Returns whether the Metal layer is enabled.
26/// This is controlled by FLTUseFlutterMetalLayer value in Info.plist.
27+ (BOOL)enabled;
28
29@end
30
31@protocol MTLCommandBuffer;
32
33@protocol FlutterMetalDrawable <CAMetalDrawable>
34
35/// In order for FlutterMetalLayer to provide back pressure it must have access
36/// to the command buffer that is used to render into the drawable to schedule
37/// a completion handler.
38/// This method must be called before the command buffer is committed.
39- (void)flutterPrepareForPresent:(nonnull id<MTLCommandBuffer>)commandBuffer;
40
41@end
42
43#endif // FLUTTER_SHELL_PLATFORM_DARWIN_IOS_FRAMEWORK_SOURCE_FLUTTERMETALLAYER_H_
CGColorSpaceRef colorspace
id< MTLDevice > preferredDevice
nullable id< CAMetalDrawable > nextDrawable()
MTLPixelFormat pixelFormat
id< MTLDevice > device
const uintptr_t id
int BOOL