| Flutter Linux Embedder |

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

Go to the source code of this file.

## Classes
struct | _FlRendererGdk

## Functions
static void | fl_renderer_gdk_make_current (FlRenderer *renderer)
static void | fl_renderer_gdk_make_resource_current (FlRenderer *renderer)
static void | fl_renderer_gdk_clear_current (FlRenderer *renderer)
static void | fl_renderer_gdk_dispose (GObject *object)
static void | fl_renderer_gdk_class_init (FlRendererGdkClass *klass)
static void | fl_renderer_gdk_init (FlRendererGdk *self)
FlRendererGdk * | fl_renderer_gdk_new (GdkWindow *window)
gboolean | fl_renderer_gdk_create_contexts (FlRendererGdk *self, GError **error)
GdkGLContext * | fl_renderer_gdk_get_context (FlRendererGdk *self)

## Function Documentation

## ◆ fl_renderer_gdk_class_init()

static void fl_renderer_gdk_class_init | ( | FlRendererGdkClass * | klass | ) |
| static

Definition at line 52 of file fl_renderer_gdk.cc.

52 {
53 G_OBJECT_CLASS(klass)->dispose = fl_renderer_gdk_dispose;
54
55 FL_RENDERER_CLASS(klass)->make_current = fl_renderer_gdk_make_current;
56 FL_RENDERER_CLASS(klass)->make_resource_current =
57 fl_renderer_gdk_make_resource_current;
58 FL_RENDERER_CLASS(klass)->clear_current = fl_renderer_gdk_clear_current;
59 }

References fl_renderer_gdk_clear_current(), fl_renderer_gdk_dispose(), fl_renderer_gdk_make_current(), and fl_renderer_gdk_make_resource_current().

## ◆ fl_renderer_gdk_clear_current()

static void fl_renderer_gdk_clear_current | ( | FlRenderer * | renderer | ) |
| static

Definition at line 38 of file fl_renderer_gdk.cc.

38 {
39 gdk_gl_context_clear_current();
40 }

Referenced by fl_renderer_gdk_class_init().

## ◆ fl_renderer_gdk_create_contexts()

gboolean fl_renderer_gdk_create_contexts | ( | FlRendererGdk * | renderer,
|  | GError ** | error
| ) |  |

fl_renderer_gdk_create_contexts: @renderer: an #FlRendererGdk. @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 70 of file fl_renderer_gdk.cc.

70 {
71 self->gdk_context = gdk_window_create_gl_context(self->window, error);
72 if (self->gdk_context == nullptr) {
73 return FALSE;
74 }
75 if (!gdk_gl_context_realize(self->gdk_context, error)) {
76 return FALSE;
77 }
78
79 self->main_context = gdk_window_create_gl_context(self->window, error);
80 if (self->main_context == nullptr) {
81 return FALSE;
82 }
83 if (!gdk_gl_context_realize(self->main_context, error)) {
84 return FALSE;
85 }
86
87 self->resource_context = gdk_window_create_gl_context(self->window, error);
88 if (self->resource_context == nullptr) {
89 return FALSE;
90 }
91 if (!gdk_gl_context_realize(self->resource_context, error)) {
92 return FALSE;
93 }
94
95 return TRUE;
96 }

References error, and TRUE.

Referenced by create_context_cb().

## ◆ fl_renderer_gdk_dispose()

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

Definition at line 42 of file fl_renderer_gdk.cc.

42 {
43 FlRendererGdk* self = FL_RENDERER_GDK(object);
44
45 g_clear_object(&self->gdk_context);
46 g_clear_object(&self->main_context);
47 g_clear_object(&self->resource_context);
48
49 G_OBJECT_CLASS(fl_renderer_gdk_parent_class)->dispose(object);
50 }

Referenced by fl_renderer_gdk_class_init().

## ◆ fl_renderer_gdk_get_context()

GdkGLContext* fl_renderer_gdk_get_context | ( | FlRendererGdk * | renderer | ) |

fl_renderer_gdk_get_context: @renderer: an #FlRendererGdk.

Returns: the main context used for rendering.

Definition at line 98 of file fl_renderer_gdk.cc.

98 {
99 g_return_val_if_fail(FL_IS_RENDERER_GDK(self), nullptr);
100 return self->gdk_context;
101 }

Referenced by create_context_cb().

## ◆ fl_renderer_gdk_init()

static void fl_renderer_gdk_init | ( | FlRendererGdk * | self | ) |
| static

Definition at line 61 of file fl_renderer_gdk.cc.

61 {}

## ◆ fl_renderer_gdk_make_current()

static void fl_renderer_gdk_make_current | ( | FlRenderer * | renderer | ) |
| static

Definition at line 26 of file fl_renderer_gdk.cc.

26 {
27 FlRendererGdk* self = FL_RENDERER_GDK(renderer);
28 gdk_gl_context_make_current(self->main_context);
29 }

Referenced by fl_renderer_gdk_class_init().

## ◆ fl_renderer_gdk_make_resource_current()

static void fl_renderer_gdk_make_resource_current | ( | FlRenderer * | renderer | ) |
| static

Definition at line 32 of file fl_renderer_gdk.cc.

32 {
33 FlRendererGdk* self = FL_RENDERER_GDK(renderer);
34 gdk_gl_context_make_current(self->resource_context);
35 }

Referenced by fl_renderer_gdk_class_init().

## ◆ fl_renderer_gdk_new()

FlRendererGdk* fl_renderer_gdk_new | ( | GdkWindow * | window | ) |

Definition at line 63 of file fl_renderer_gdk.cc.

63 {
64 FlRendererGdk* self =
65 FL_RENDERER_GDK(g_object_new(fl_renderer_gdk_get_type(), nullptr));
66 self->window = window;
67 return self;
68 }

Referenced by create_context_cb().

fl_renderer_gdk_clear_current
static void fl_renderer_gdk_clear_current(FlRenderer *renderer)
Definition: fl_renderer_gdk.cc:38
fl_renderer_gdk_make_resource_current
static void fl_renderer_gdk_make_resource_current(FlRenderer *renderer)
Definition: fl_renderer_gdk.cc:32
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
fl_renderer_gdk_make_current
static void fl_renderer_gdk_make_current(FlRenderer *renderer)
Definition: fl_renderer_gdk.cc:26
fl_renderer_gdk_dispose
static void fl_renderer_gdk_dispose(GObject *object)
Definition: fl_renderer_gdk.cc:42