| Flutter Linux Embedder |

Functions
fl_renderer_gdk.h File Reference
`#include "flutter/shell/platform/linux/fl_renderer.h"`

Go to the source code of this file.

## Functions
G_BEGIN_DECLS | G_DECLARE_FINAL_TYPE (FlRendererGdk, fl_renderer_gdk, FL, RENDERER_GDK, FlRenderer) FlRendererGdk *fl_renderer_gdk_new()
void | fl_renderer_gdk_set_window (FlRendererGdk *renderer, GdkWindow *window)
gboolean | fl_renderer_gdk_create_contexts (FlRendererGdk *renderer, GError **error)
GdkGLContext * | fl_renderer_gdk_get_context (FlRendererGdk *renderer)

## Function Documentation

## ◆ 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 95 of file fl_renderer_gdk.cc.

95 {
96 g_return_val_if_fail(FL_IS_RENDERER_GDK(self), FALSE);
97
98 self->gdk_context = gdk_window_create_gl_context(self->window, error);
99 if (self->gdk_context == nullptr) {
100 return FALSE;
101 }
102 if (!gdk_gl_context_realize(self->gdk_context, error)) {
103 return FALSE;
104 }
105
106 self->main_context = gdk_window_create_gl_context(self->window, error);
107 if (self->main_context == nullptr) {
108 return FALSE;
109 }
110 if (!gdk_gl_context_realize(self->main_context, error)) {
111 return FALSE;
112 }
113
114 self->resource_context = gdk_window_create_gl_context(self->window, error);
115 if (self->resource_context == nullptr) {
116 return FALSE;
117 }
118 if (!gdk_gl_context_realize(self->resource_context, error)) {
119 return FALSE;
120 }
121
122 return TRUE;
123 }

References error, and TRUE.

Referenced by create_context_cb().

## ◆ 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 125 of file fl_renderer_gdk.cc.

125 {
126 g_return_val_if_fail(FL_IS_RENDERER_GDK(self), nullptr);
127 return self->gdk_context;
128 }

Referenced by create_context_cb().

## ◆ fl_renderer_gdk_set_window()

void fl_renderer_gdk_set_window | ( | FlRendererGdk * | renderer,
|  | GdkWindow * | window
| ) |  |

fl_renderer_gdk_set_window: @renderer: an #FlRendererGdk. @window: the window that is being rendered on.

Set the window that is being rendered on. This is only called once when the window is available.

Definition at line 88 of file fl_renderer_gdk.cc.

88 {
89 g_return_if_fail(FL_IS_RENDERER_GDK(self));
90
91 g_assert(self->window == nullptr);
92 self->window = window;
93 }

Referenced by create_context_cb().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlRendererGdk | ,
|  | fl_renderer_gdk | ,
|  | FL | ,
|  | RENDERER_GDK | ,
|  | FlRenderer |
| ) |  |

FlRendererGdk:

#FlRendererGdk is an implementation of #FlRenderer that renders by OpenGL ES. fl_renderer_gdk_new:

Creates an object that allows Flutter to render by OpenGL ES.

Returns: a new #FlRendererGdk.

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