| Flutter macOS Embedder |

FlutterExternalTexture.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_FLUTTEREXTERNALTEXTURE_H_
6 #define FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTEREXTERNALTEXTURE_H_
7
8 #import <Foundation/Foundation.h>
9
10 #import "flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.h"
11 #include "flutter/shell/platform/embedder/embedder.h"
12
13 /**
14 * Embedding side texture wrappers for Metal external textures.
15 * Used to bridge FlutterTexture object and handle the texture copy request the
16 * Flutter engine.
17 */
18 @interface FlutterExternalTexture : NSObject
19
20 /**
21 * Initializes a texture adapter with |texture|.
22 */
23 - (nonnull instancetype)initWithFlutterTexture:(nonnull id<FlutterTexture>)texture
24 darwinMetalContext:(nonnull FlutterDarwinContextMetalSkia*)context;
25
26 /**
27 * Returns the ID for the FlutterExternalTexture instance.
28 */
29 - (int64_t)textureID;
30
31 /**
32 * Accepts texture buffer copy request from the Flutter engine.
33 * When the user side marks the textureID as available, the Flutter engine will
34 * callback to this method and ask for populate the |metalTexture| object,
35 * such as the texture type and the format of the pixel buffer and the texture object.
36 */
37 - (BOOL)populateTexture:(nonnull FlutterMetalExternalTexture*)metalTexture;
38
39 @end
40
41 #endif // FLUTTER_SHELL_PLATFORM_DARWIN_MACOS_FRAMEWORK_SOURCE_FLUTTEREXTERNALTEXTURE_H_
FlutterExternalTexture
Definition: FlutterExternalTexture.h:18
-[FlutterExternalTexture textureID]
int64_t textureID()
Definition: FlutterExternalTexture.mm:30
FlutterTexture-p
Definition: FlutterTexture.h:21