| 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 48 of file fl_renderer_gdk.cc.

48 {
49 G_OBJECT_CLASS(klass)->dispose = fl_renderer_gdk_dispose;
50
51 FL_RENDERER_CLASS(klass)->make_current = fl_renderer_gdk_make_current;
52 FL_RENDERER_CLASS(klass)->make_resource_current =
53 fl_renderer_gdk_make_resource_current;
54 FL_RENDERER_CLASS(klass)->clear_current = fl_renderer_gdk_clear_current;
55 }

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 35 of file fl_renderer_gdk.cc.

35 {
36 gdk_gl_context_clear_current();
37 }

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 66 of file fl_renderer_gdk.cc.

66 {
67 self->main_context = gdk_window_create_gl_context(self->window, error);
68 if (self->main_context == nullptr) {
69 return FALSE;
70 }
71 if (!gdk_gl_context_realize(self->main_context, error)) {
72 return FALSE;
73 }
74
75 self->resource_context = gdk_window_create_gl_context(self->window, error);
76 if (self->resource_context == nullptr) {
77 return FALSE;
78 }
79 if (!gdk_gl_context_realize(self->resource_context, error)) {
80 return FALSE;
81 }
82
83 return TRUE;
84 }

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 39 of file fl_renderer_gdk.cc.

39 {
40 FlRendererGdk* self = FL_RENDERER_GDK(object);
41
42 g_clear_object(&self->main_context);
43 g_clear_object(&self->resource_context);
44
45 G_OBJECT_CLASS(fl_renderer_gdk_parent_class)->dispose(object);
46 }

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 86 of file fl_renderer_gdk.cc.

86 {
87 g_return_val_if_fail(FL_IS_RENDERER_GDK(self), nullptr);
88 return self->main_context;
89 }

Referenced by create_context_cb().

## ◆ fl_renderer_gdk_init()

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

Definition at line 57 of file fl_renderer_gdk.cc.

57 {}

## ◆ fl_renderer_gdk_make_current()

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

Definition at line 23 of file fl_renderer_gdk.cc.

23 {
24 FlRendererGdk* self = FL_RENDERER_GDK(renderer);
25 gdk_gl_context_make_current(self->main_context);
26 }

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 29 of file fl_renderer_gdk.cc.

29 {
30 FlRendererGdk* self = FL_RENDERER_GDK(renderer);
31 gdk_gl_context_make_current(self->resource_context);
32 }

Referenced by fl_renderer_gdk_class_init().

## ◆ fl_renderer_gdk_new()

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

Definition at line 59 of file fl_renderer_gdk.cc.

59 {
60 FlRendererGdk* self =
61 FL_RENDERER_GDK(g_object_new(fl_renderer_gdk_get_type(), nullptr));
62 self->window = window;
63 return self;
64 }

Referenced by create_context_cb().

fl_renderer_gdk_clear_current
static void fl_renderer_gdk_clear_current(FlRenderer *renderer)
Definition: fl_renderer_gdk.cc:35
fl_renderer_gdk_make_resource_current
static void fl_renderer_gdk_make_resource_current(FlRenderer *renderer)
Definition: fl_renderer_gdk.cc:29
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:23
fl_renderer_gdk_dispose
static void fl_renderer_gdk_dispose(GObject *object)
Definition: fl_renderer_gdk.cc:39