| Flutter macOS Embedder |

FlutterSurface.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_MACOS_FRAMEWORK_SOURCE_FLUTTERSURFACE_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERSURFACE_H_
7
8 #import <Cocoa/Cocoa.h>
9
10 #import "flutter/shell/platform/embedder/embedder.h"
11
12 /**
13 * Opaque surface type.
14 * Can be represented as FlutterMetalTexture to cross the embedder API boundary.
15 */
16 @interface FlutterSurface : NSObject
17
18 - (FlutterMetalTexture)asFlutterMetalTexture;
19
20 + (nullable FlutterSurface*)fromFlutterMetalTexture:(nonnull const FlutterMetalTexture*)texture;
21
22 @end
23
24 /**
25 * Internal FlutterSurface interface used by FlutterSurfaceManager.
26 * Wraps an IOSurface framebuffer and metadata related to the surface.
27 */
28 @interface FlutterSurface (Private)
29
30 - (nonnull instancetype)initWithSize:(CGSize)size device:(nonnull id<MTLDevice>)device;
31
32 @property(readonly, nonatomic, nonnull) IOSurfaceRef ioSurface;
33 @property(readonly, nonatomic) CGSize size;
34 @property(readonly, nonatomic) int64_t textureId;
35 // Whether the surface is currently in use by the compositor.
36 @property(readonly, nonatomic) BOOL isInUse;
37
38 @end
39
40 @interface FlutterSurface (Testing)
41 @property(readwrite, nonatomic) BOOL isInUseOverride;
42 @end
43
44 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTERSURFACE_H_
FlutterSurface(Private)
Definition: FlutterSurface.h:28
FlutterSurface(Testing)
Definition: FlutterSurface.h:40
FlutterSurface
Definition: FlutterSurface.h:17
-[FlutterSurface asFlutterMetalTexture]
FlutterMetalTexture asFlutterMetalTexture()
Definition: FlutterSurface.mm:56