| Flutter Linux Embedder |

Classes | Functions
fl_opengl_manager.cc File Reference
`#include "flutter/shell/platform/linux/fl_opengl_manager.h"`

Go to the source code of this file.

## Classes
struct | _FlOpenGLManager

## Functions
static void | fl_opengl_manager_dispose (GObject *object)
static void | fl_opengl_manager_class_init (FlOpenGLManagerClass *klass)
static void | fl_opengl_manager_init (FlOpenGLManager *self)
FlOpenGLManager * | fl_opengl_manager_new ()
gboolean | fl_opengl_manager_create_contexts (FlOpenGLManager *self, GdkWindow *window, GError **error)
GdkGLContext * | fl_opengl_manager_get_context (FlOpenGLManager *self)
void | fl_opengl_manager_make_current (FlOpenGLManager *self)
void | fl_opengl_manager_make_resource_current (FlOpenGLManager *self)
void | fl_opengl_manager_clear_current (FlOpenGLManager *self)

## Function Documentation

## ◆ fl_opengl_manager_class_init()

static void fl_opengl_manager_class_init | ( | FlOpenGLManagerClass * | klass | ) |
| static

Definition at line 33 of file fl_opengl_manager.cc.

33 {
34 G_OBJECT_CLASS(klass)->dispose = fl_opengl_manager_dispose;
35 }
fl_opengl_manager_dispose
static void fl_opengl_manager_dispose(GObject *object)
Definition: fl_opengl_manager.cc:23

References fl_opengl_manager_dispose().

## ◆ fl_opengl_manager_clear_current()

void fl_opengl_manager_clear_current | ( | FlOpenGLManager * | manager | ) |

fl_opengl_manager_clear_current: @manager: an #FlOpenGLManager.

Clears the current rendering context.

Definition at line 90 of file fl_opengl_manager.cc.

90 {
91 gdk_gl_context_clear_current();
92 }

Referenced by fl_compositor_opengl_present_layers(), fl_engine_gl_clear_current(), present_layers_task_cb(), and realize_cb().

## ◆ fl_opengl_manager_create_contexts()

gboolean fl_opengl_manager_create_contexts | ( | FlOpenGLManager * | manager,
|  | GdkWindow * | window,
|  | GError ** | error
| ) |  |

fl_opengl_manager_create_contexts: @manager: an #FlOpenGLManager. @window: the window that is being rendered on. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore.

Create rendering contexts.

Returns: TRUE if contexts were created, FALSE if there was an error.

Definition at line 45 of file fl_opengl_manager.cc.

47 {
48 g_return_val_if_fail(FL_IS_OPENGL_MANAGER(self), FALSE);
49
50 self->gdk_context = gdk_window_create_gl_context(window, error);
51 if (self->gdk_context == nullptr) {
52 return FALSE;
53 }
54 if (!gdk_gl_context_realize(self->gdk_context, error)) {
55 return FALSE;
56 }
57
58 self->main_context = gdk_window_create_gl_context(window, error);
59 if (self->main_context == nullptr) {
60 return FALSE;
61 }
62 if (!gdk_gl_context_realize(self->main_context, error)) {
63 return FALSE;
64 }
65
66 self->resource_context = gdk_window_create_gl_context(window, error);
67 if (self->resource_context == nullptr) {
68 return FALSE;
69 }
70 if (!gdk_gl_context_realize(self->resource_context, error)) {
71 return FALSE;
72 }
73
74 return TRUE;
75 }
window
return window
Definition: fl_application.cc:41
TRUE
return TRUE
Definition: fl_pixel_buffer_texture_test.cc:53
error
const uint8_t uint32_t uint32_t GError ** error
Definition: fl_pixel_buffer_texture_test.cc:40

References error, TRUE, and window.

Referenced by create_context_cb().

## ◆ fl_opengl_manager_dispose()

static void fl_opengl_manager_dispose | ( | GObject * | object | ) |
| static

Definition at line 23 of file fl_opengl_manager.cc.

23 {
24 FlOpenGLManager* self = FL_OPENGL_MANAGER(object);
25
26 g_clear_object(&self->gdk_context);
27 g_clear_object(&self->main_context);
28 g_clear_object(&self->resource_context);
29
30 G_OBJECT_CLASS(fl_opengl_manager_parent_class)->dispose(object);
31 }

Referenced by fl_opengl_manager_class_init().

## ◆ fl_opengl_manager_get_context()

GdkGLContext* fl_opengl_manager_get_context | ( | FlOpenGLManager * | manager | ) |

fl_opengl_manager_get_context: @manager: an #FlOpenGLManager.

Returns: the main context used for rendering.

Definition at line 77 of file fl_opengl_manager.cc.

77 {
78 g_return_val_if_fail(FL_IS_OPENGL_MANAGER(self), nullptr);
79 return self->gdk_context;
80 }

Referenced by create_context_cb().

## ◆ fl_opengl_manager_init()

static void fl_opengl_manager_init | ( | FlOpenGLManager * | self | ) |
| static

Definition at line 37 of file fl_opengl_manager.cc.

37 {}

## ◆ fl_opengl_manager_make_current()

void fl_opengl_manager_make_current | ( | FlOpenGLManager * | manager | ) |

fl_opengl_manager_make_current: @manager: an #FlOpenGLManager.

Makes the rendering context current.

Definition at line 82 of file fl_opengl_manager.cc.

82 {
83 gdk_gl_context_make_current(self->main_context);
84 }

Referenced by fl_compositor_opengl_collect_backing_store(), fl_compositor_opengl_create_backing_store(), fl_compositor_opengl_present_layers(), fl_engine_gl_make_current(), present_layers_task_cb(), realize_cb(), and unrealize_cb().

## ◆ fl_opengl_manager_make_resource_current()

void fl_opengl_manager_make_resource_current | ( | FlOpenGLManager * | manager | ) |

fl_opengl_manager_make_resource_current: @manager: an #FlOpenGLManager.

Makes the resource rendering context current.

Definition at line 86 of file fl_opengl_manager.cc.

86 {
87 gdk_gl_context_make_current(self->resource_context);
88 }

Referenced by fl_engine_gl_make_resource_current().

## ◆ fl_opengl_manager_new()

FlOpenGLManager* fl_opengl_manager_new | ( |  | ) |

Definition at line 39 of file fl_opengl_manager.cc.

39 {
40 FlOpenGLManager* self =
41 FL_OPENGL_MANAGER(g_object_new(fl_opengl_manager_get_type(), nullptr));
42 return self;
43 }

Referenced by fl_engine_init().