| Flutter Windows Embedder |

Classes | Typedefs | Enumerations | Functions | Variables
flutter_texture_registrar.h File Reference
`#include <stddef.h>`
`#include <stdint.h>`
`#include "flutter_export.h"`

Go to the source code of this file.

## Classes
struct | FlutterDesktopPixelBuffer
struct | FlutterDesktopGpuSurfaceDescriptor
struct | FlutterDesktopPixelBufferTextureConfig
struct | FlutterDesktopGpuSurfaceTextureConfig
struct | FlutterDesktopTextureInfo

## Typedefs
typedef struct FlutterDesktopTextureRegistrar * | FlutterDesktopTextureRegistrarRef

## Enumerations
enum | FlutterDesktopTextureType { kFlutterDesktopPixelBufferTexture, kFlutterDesktopGpuSurfaceTexture }
enum | FlutterDesktopGpuSurfaceType { kFlutterDesktopGpuSurfaceTypeNone, kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle, kFlutterDesktopGpuSurfaceTypeD3d11Texture2D }
enum | FlutterDesktopPixelFormat { kFlutterDesktopPixelFormatNone, kFlutterDesktopPixelFormatRGBA8888, kFlutterDesktopPixelFormatBGRA8888 }

## Functions
FLUTTER_EXPORT int64_t | FlutterDesktopTextureRegistrarRegisterExternalTexture (FlutterDesktopTextureRegistrarRef texture_registrar, const FlutterDesktopTextureInfo *info)
FLUTTER_EXPORT void | FlutterDesktopTextureRegistrarUnregisterExternalTexture (FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id, void(*callback)(void *user_data), void *user_data)
FLUTTER_EXPORT bool | FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable (FlutterDesktopTextureRegistrarRef texture_registrar, int64_t texture_id)

## Variables
const typedef FlutterDesktopPixelBuffer *(* | FlutterDesktopPixelBufferTextureCallback )(size_t width, size_t height, void *user_data)
const typedef FlutterDesktopGpuSurfaceDescriptor *(* | FlutterDesktopGpuSurfaceTextureCallback )(size_t width, size_t height, void *user_data)

## Typedef Documentation

## ◆ FlutterDesktopTextureRegistrarRef

typedef struct FlutterDesktopTextureRegistrar* FlutterDesktopTextureRegistrarRef

Definition at line 19 of file flutter_texture_registrar.h.

## Enumeration Type Documentation

## ◆ FlutterDesktopGpuSurfaceType

enum FlutterDesktopGpuSurfaceType

Enumerator
kFlutterDesktopGpuSurfaceTypeNone |
kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle |
kFlutterDesktopGpuSurfaceTypeD3d11Texture2D |

Definition at line 32 of file flutter_texture_registrar.h.

32 {
33 // Uninitialized.
34 kFlutterDesktopGpuSurfaceTypeNone,
35 // A DXGI shared texture handle (Windows only).
36 // See
37 // https://docs.microsoft.com/en-us/windows/win32/api/dxgi/nf-dxgi-idxgiresource-getsharedhandle
38 kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle,
39 // A |ID3D11Texture2D| (Windows only).
40 kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
41 } FlutterDesktopGpuSurfaceType;

## ◆ FlutterDesktopPixelFormat

enum FlutterDesktopPixelFormat

Enumerator
kFlutterDesktopPixelFormatNone |
kFlutterDesktopPixelFormatRGBA8888 |
kFlutterDesktopPixelFormatBGRA8888 |

Definition at line 44 of file flutter_texture_registrar.h.

44 {
45 // Uninitialized.
46 kFlutterDesktopPixelFormatNone,
47 // Represents a 32-bit RGBA color format with 8 bits each for red, green, blue
48 // and alpha.
49 kFlutterDesktopPixelFormatRGBA8888,
50 // Represents a 32-bit BGRA color format with 8 bits each for blue, green, red
51 // and alpha.
52 kFlutterDesktopPixelFormatBGRA8888
53 } FlutterDesktopPixelFormat;

## ◆ FlutterDesktopTextureType

enum FlutterDesktopTextureType

Enumerator
kFlutterDesktopPixelBufferTexture |
kFlutterDesktopGpuSurfaceTexture |

Definition at line 24 of file flutter_texture_registrar.h.

24 {
25 // A Pixel buffer-based texture.
26 kFlutterDesktopPixelBufferTexture,
27 // A platform-specific GPU surface-backed texture.
28 kFlutterDesktopGpuSurfaceTexture
29 } FlutterDesktopTextureType;

## Function Documentation

## ◆ FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable()

FLUTTER_EXPORT bool FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable | ( | FlutterDesktopTextureRegistrarRef | texture_registrar,
|  | int64_t | texture_id
| ) |  |

Definition at line 401 of file flutter_windows.cc.

403 {
404 return TextureRegistrarFromHandle(texture_registrar)
405 ->MarkTextureFrameAvailable(texture_id);
406 }

References flutter::FlutterWindowsTextureRegistrar::MarkTextureFrameAvailable(), texture_id, and TextureRegistrarFromHandle().

Referenced by flutter::TextureRegistrarImpl::MarkTextureFrameAvailable().

## ◆ FlutterDesktopTextureRegistrarRegisterExternalTexture()

FLUTTER_EXPORT int64_t FlutterDesktopTextureRegistrarRegisterExternalTexture | ( | FlutterDesktopTextureRegistrarRef | texture_registrar,
|  | const FlutterDesktopTextureInfo * | info
| ) |  |

Definition at line 380 of file flutter_windows.cc.

382 {
383 return TextureRegistrarFromHandle(texture_registrar)
384 ->RegisterTexture(texture_info);
385 }

References flutter::FlutterWindowsTextureRegistrar::RegisterTexture(), and TextureRegistrarFromHandle().

Referenced by flutter::TextureRegistrarImpl::RegisterTexture().

## ◆ FlutterDesktopTextureRegistrarUnregisterExternalTexture()

FLUTTER_EXPORT void FlutterDesktopTextureRegistrarUnregisterExternalTexture | ( | FlutterDesktopTextureRegistrarRef | texture_registrar,
|  | int64_t | texture_id,
|  | void(*)(void *user_data) | callback,
|  | void * | user_data
| ) |  |

Definition at line 387 of file flutter_windows.cc.

391 {
392 auto registrar = TextureRegistrarFromHandle(texture_registrar);
393 if (callback) {
394 registrar->UnregisterTexture(
395 texture_id, [callback, user_data]() { callback(user_data); });
396 return;
397 }
398 registrar->UnregisterTexture(texture_id);
399 }

References callback, texture_id, TextureRegistrarFromHandle(), and user_data.

Referenced by flutter::TextureRegistrarImpl::UnregisterTexture().

## Variable Documentation

## ◆ FlutterDesktopGpuSurfaceTextureCallback

const typedef FlutterDesktopGpuSurfaceDescriptor*( * FlutterDesktopGpuSurfaceTextureCallback) (size_t width, size_t height, void *user_data)

Definition at line 125 of file flutter_texture_registrar.h.

## ◆ FlutterDesktopPixelBufferTextureCallback

const typedef FlutterDesktopPixelBuffer*( * FlutterDesktopPixelBufferTextureCallback) (size_t width, size_t height, void *user_data)

Definition at line 116 of file flutter_texture_registrar.h.

TextureRegistrarFromHandle
static flutter::FlutterWindowsTextureRegistrar * TextureRegistrarFromHandle(FlutterDesktopTextureRegistrarRef ref)
Definition: flutter_windows.cc:64
kFlutterDesktopGpuSurfaceTexture
@ kFlutterDesktopGpuSurfaceTexture
Definition: flutter_texture_registrar.h:28
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:49
flutter::FlutterWindowsTextureRegistrar::MarkTextureFrameAvailable
bool MarkTextureFrameAvailable(int64_t texture_id)
Definition: flutter_windows_texture_registrar.cc:103
kFlutterDesktopGpuSurfaceTypeNone
@ kFlutterDesktopGpuSurfaceTypeNone
Definition: flutter_texture_registrar.h:34
FlutterDesktopTextureType
FlutterDesktopTextureType
Definition: flutter_texture_registrar.h:24
kFlutterDesktopPixelFormatBGRA8888
@ kFlutterDesktopPixelFormatBGRA8888
Definition: flutter_texture_registrar.h:52
FlutterDesktopGpuSurfaceType
FlutterDesktopGpuSurfaceType
Definition: flutter_texture_registrar.h:32
FlutterDesktopPixelFormat
FlutterDesktopPixelFormat
Definition: flutter_texture_registrar.h:44
kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
@ kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
Definition: flutter_texture_registrar.h:40
kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
@ kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
Definition: flutter_texture_registrar.h:38
texture_id
int64_t texture_id
Definition: texture_registrar_unittests.cc:24
kFlutterDesktopPixelFormatNone
@ kFlutterDesktopPixelFormatNone
Definition: flutter_texture_registrar.h:46
kFlutterDesktopPixelBufferTexture
@ kFlutterDesktopPixelBufferTexture
Definition: flutter_texture_registrar.h:26
kFlutterDesktopPixelFormatRGBA8888
@ kFlutterDesktopPixelFormatRGBA8888
Definition: flutter_texture_registrar.h:49
flutter::FlutterWindowsTextureRegistrar::RegisterTexture
int64_t RegisterTexture(const FlutterDesktopTextureInfo *texture_info)
Definition: flutter_windows_texture_registrar.cc:26
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:48