| Flutter Windows Embedder |

Classes | Typedefs | Enumerations | Functions
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
typedef const FlutterDesktopPixelBuffer *(* | FlutterDesktopPixelBufferTextureCallback) (size_t width, size_t height, void *user_data)
typedef const FlutterDesktopGpuSurfaceDescriptor *(* | FlutterDesktopGpuSurfaceTextureCallback) (size_t width, size_t height, void *user_data)

## 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)

## Typedef Documentation

## ◆ FlutterDesktopGpuSurfaceTextureCallback

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

Definition at line 124 of file flutter_texture_registrar.h.

## ◆ FlutterDesktopPixelBufferTextureCallback

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

Definition at line 115 of file flutter_texture_registrar.h.

## ◆ FlutterDesktopTextureRegistrarRef

typedef struct FlutterDesktopTextureRegistrar* FlutterDesktopTextureRegistrarRef

Definition at line 20 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;
FlutterDesktopGpuSurfaceType
FlutterDesktopGpuSurfaceType
Definition: flutter_texture_registrar.h:32
kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
@ kFlutterDesktopGpuSurfaceTypeDxgiSharedHandle
Definition: flutter_texture_registrar.h:38
kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
@ kFlutterDesktopGpuSurfaceTypeD3d11Texture2D
Definition: flutter_texture_registrar.h:40
kFlutterDesktopGpuSurfaceTypeNone
@ kFlutterDesktopGpuSurfaceTypeNone
Definition: flutter_texture_registrar.h:34

## ◆ 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;
FlutterDesktopPixelFormat
FlutterDesktopPixelFormat
Definition: flutter_texture_registrar.h:44
kFlutterDesktopPixelFormatBGRA8888
@ kFlutterDesktopPixelFormatBGRA8888
Definition: flutter_texture_registrar.h:52
kFlutterDesktopPixelFormatNone
@ kFlutterDesktopPixelFormatNone
Definition: flutter_texture_registrar.h:46
kFlutterDesktopPixelFormatRGBA8888
@ kFlutterDesktopPixelFormatRGBA8888
Definition: flutter_texture_registrar.h:49

## ◆ 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;
FlutterDesktopTextureType
FlutterDesktopTextureType
Definition: flutter_texture_registrar.h:24
kFlutterDesktopGpuSurfaceTexture
@ kFlutterDesktopGpuSurfaceTexture
Definition: flutter_texture_registrar.h:28
kFlutterDesktopPixelBufferTexture
@ kFlutterDesktopPixelBufferTexture
Definition: flutter_texture_registrar.h:26

## Function Documentation

## ◆ FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable()

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

Definition at line 455 of file flutter_windows.cc.

457 {
458 return TextureRegistrarFromHandle(texture_registrar)
459 ->MarkTextureFrameAvailable(texture_id);
460 }
flutter::FlutterWindowsTextureRegistrar::MarkTextureFrameAvailable
bool MarkTextureFrameAvailable(int64_t texture_id)
Definition: flutter_windows_texture_registrar.cc:103
texture_id
uint32_t texture_id
Definition: compositor_opengl.cc:20
TextureRegistrarFromHandle
static flutter::FlutterWindowsTextureRegistrar * TextureRegistrarFromHandle(FlutterDesktopTextureRegistrarRef ref)
Definition: flutter_windows.cc:64

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 434 of file flutter_windows.cc.

436 {
437 return TextureRegistrarFromHandle(texture_registrar)
438 ->RegisterTexture(texture_info);
439 }
flutter::FlutterWindowsTextureRegistrar::RegisterTexture
int64_t RegisterTexture(const FlutterDesktopTextureInfo *texture_info)
Definition: flutter_windows_texture_registrar.cc:26

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 441 of file flutter_windows.cc.

445 {
446 auto registrar = TextureRegistrarFromHandle(texture_registrar);
447 if (callback) {
448 registrar->UnregisterTexture(
449 texture_id, [callback, user_data]() { callback(user_data); });
450 return;
451 }
452 registrar->UnregisterTexture(texture_id);
453 }
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:53
callback
FlutterDesktopBinaryReply callback
Definition: flutter_windows_view_unittests.cc:52

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

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