| Flutter Linux Embedder |

Functions | Variables
fl_backing_store_provider.h File Reference
`#include <gtk/gtk.h>`
`#include <cstdint>`

Go to the source code of this file.

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlBackingStoreProvider, fl_backing_store_provider, FL, BACKING_STORE_PROVIDER, GObject) FlBackingStoreProvider *fl_backing_store_provider_new(int width
uint32_t | fl_backing_store_provider_get_gl_framebuffer_id (FlBackingStoreProvider *provider)
uint32_t | fl_backing_store_provider_get_gl_texture_id (FlBackingStoreProvider *provider)
uint32_t | fl_backing_store_provider_get_gl_target (FlBackingStoreProvider *provider)
uint32_t | fl_backing_store_provider_get_gl_format (FlBackingStoreProvider *provider)
GdkRectangle | fl_backing_store_provider_get_geometry (FlBackingStoreProvider *provider)

## Variables
G_BEGIN_DECLS int | height = kRealBufferHeight

## Function Documentation

## ◆ fl_backing_store_provider_get_geometry()

GdkRectangle fl_backing_store_provider_get_geometry | ( | FlBackingStoreProvider * | provider | ) |

fl_backing_store_provider_get_geometry: @provider: an #FlBackingStoreProvider.

Gets geometry of framebuffer.

Returns: geometry of backing store.

Definition at line 104 of file fl_backing_store_provider.cc.

105 {
106 return self->geometry;
107 }

Referenced by fl_gl_area_draw().

## ◆ fl_backing_store_provider_get_gl_format()

uint32_t fl_backing_store_provider_get_gl_format | ( | FlBackingStoreProvider * | provider | ) |

fl_backing_store_provider_get_gl_format: @provider: an #FlBackingStoreProvider.

Gets texture format (example GL_RGBA8).

Returns: texture format.

Definition at line 80 of file fl_backing_store_provider.cc.

80 {
81 // Flutter defines SK_R32_SHIFT=16, so SK_PMCOLOR_BYTE_ORDER should be BGRA.
82 // In Linux kN32_SkColorType is assumed to be kBGRA_8888_SkColorType.
83 // So we must choose a valid gl format to be compatible with surface format
84 // BGRA8.
85 // Following logics are copied from Skia GrGLCaps.cpp.
86
87 if (epoxy_is_desktop_gl()) {
88 // For OpenGL.
89 if (epoxy_gl_version() >= 12 || epoxy_has_gl_extension("GL_EXT_bgra")) {
90 return GL_RGBA8;
91 }
92 } else {
93 // For OpenGL ES.
94 if (epoxy_has_gl_extension("GL_EXT_texture_format_BGRA8888") ||
95 (epoxy_has_gl_extension("GL_APPLE_texture_format_BGRA8888") &&
96 epoxy_gl_version() >= 30)) {
97 return GL_BGRA8_EXT;
98 }
99 }
100 g_critical("Failed to determine valid GL format for Flutter rendering");
101 return GL_RGBA8;
102 }

Referenced by fl_renderer_gl_create_backing_store().

## ◆ fl_backing_store_provider_get_gl_framebuffer_id()

uint32_t fl_backing_store_provider_get_gl_framebuffer_id | ( | FlBackingStoreProvider * | provider | ) |

fl_backing_store_provider_get_gl_framebuffer_id: @provider: an #FlBackingStoreProvider.

Gets created framebuffer id.

Returns: gl framebuffer id, 0 if creation failed.

Definition at line 66 of file fl_backing_store_provider.cc.

67 {
68 return self->framebuffer_id;
69 }

Referenced by fl_renderer_gl_create_backing_store().

## ◆ fl_backing_store_provider_get_gl_target()

uint32_t fl_backing_store_provider_get_gl_target | ( | FlBackingStoreProvider * | provider | ) |

fl_backing_store_provider_get_gl_target: @provider: an #FlBackingStoreProvider.

Gets target texture (example GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE).

Returns: target texture.

Definition at line 76 of file fl_backing_store_provider.cc.

76 {
77 return GL_TEXTURE_2D;
78 }

## ◆ fl_backing_store_provider_get_gl_texture_id()

uint32_t fl_backing_store_provider_get_gl_texture_id | ( | FlBackingStoreProvider * | provider | ) |

fl_backing_store_provider_get_gl_texture_id: @provider: an #FlBackingStoreProvider.

Gets created texture id.

Returns: gl texture id, 0 if creation failed.

Definition at line 71 of file fl_backing_store_provider.cc.

72 {
73 return self->texture_id;
74 }

Referenced by fl_gl_area_draw().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlBackingStoreProvider | ,
|  | fl_backing_store_provider | ,
|  | FL | ,
|  | BACKING_STORE_PROVIDER | ,
|  | GObject |
| ) |  |

FlBackingStoreProvider:

#FlBackingStoreProvider creates framebuffers and their backing textures for embedder compositor. fl_backing_store_provider_new: @width: width of texture. @height: height of texture.

Creates a new frame buffer. fl_renderer_make_current() must be called first.

Returns: a new #FlBackingStoreProvider.

## Variable Documentation

## ◆ height

* height = kRealBufferHeight

Definition at line 37 of file fl_backing_store_provider.h.

Referenced by flutter::PixelBufferTexture::CopyPixelBuffer(), fl_accessible_node_get_extents(), fl_accessible_node_set_extents(), fl_accessible_node_set_extents_impl(), fl_backing_store_provider_new(), fl_engine_gl_external_texture_frame_callback(), fl_engine_send_window_metrics_event(), fl_pixel_buffer_texture_populate(), fl_test_texture_populate(), fl_texture_gl_populate(), G_DECLARE_DERIVABLE_TYPE(), flutter::GpuSurfaceTexture::ObtainDescriptor(), flutter::TextureRegistrarImpl::RegisterTexture(), TEST(), and flutter::TEST().