#include "flutter/shell/platform/linux/fl_renderer_gdk.h"
Go to the source code of this file.
◆ fl_renderer_gdk_class_init()
static void fl_renderer_gdk_class_init |
( |
FlRendererGdkClass * |
klass | ) |
|
|
static |
Definition at line 69 of file fl_renderer_gdk.cc.
69 {
71
73 FL_RENDERER_CLASS(klass)->make_resource_current =
77}
static void fl_renderer_gdk_make_resource_current(FlRenderer *renderer)
static void fl_renderer_gdk_dispose(GObject *object)
static void fl_renderer_gdk_make_current(FlRenderer *renderer)
static gdouble fl_renderer_gdk_get_refresh_rate(FlRenderer *renderer)
static void fl_renderer_gdk_clear_current(FlRenderer *renderer)
◆ fl_renderer_gdk_clear_current()
static void fl_renderer_gdk_clear_current |
( |
FlRenderer * |
renderer | ) |
|
|
static |
◆ 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 88 of file fl_renderer_gdk.cc.
88 {
89 self->gdk_context = gdk_window_create_gl_context(
self->window,
error);
90 if (
self->gdk_context ==
nullptr) {
92 }
93 if (!gdk_gl_context_realize(
self->gdk_context,
error)) {
95 }
96
97 self->main_context = gdk_window_create_gl_context(
self->window,
error);
98 if (
self->main_context ==
nullptr) {
100 }
101 if (!gdk_gl_context_realize(
self->main_context,
error)) {
103 }
104
105 self->resource_context = gdk_window_create_gl_context(
self->window,
error);
106 if (
self->resource_context ==
nullptr) {
108 }
109 if (!gdk_gl_context_realize(
self->resource_context,
error)) {
111 }
112
114}
const uint8_t uint32_t uint32_t GError ** error
◆ fl_renderer_gdk_dispose()
static void fl_renderer_gdk_dispose |
( |
GObject * |
object | ) |
|
|
static |
Definition at line 59 of file fl_renderer_gdk.cc.
59 {
60 FlRendererGdk*
self = FL_RENDERER_GDK(
object);
61
62 g_clear_object(&
self->gdk_context);
63 g_clear_object(&
self->main_context);
64 g_clear_object(&
self->resource_context);
65
66 G_OBJECT_CLASS(fl_renderer_gdk_parent_class)->dispose(object);
67}
◆ 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 116 of file fl_renderer_gdk.cc.
116 {
117 g_return_val_if_fail(FL_IS_RENDERER_GDK(
self),
nullptr);
118 return self->gdk_context;
119}
◆ fl_renderer_gdk_get_refresh_rate()
static gdouble fl_renderer_gdk_get_refresh_rate |
( |
FlRenderer * |
renderer | ) |
|
|
static |
Definition at line 42 of file fl_renderer_gdk.cc.
42 {
44 GdkDisplay* display = gdk_window_get_display(
self->window);
45 GdkMonitor* monitor =
46 gdk_display_get_monitor_at_window(display,
self->window);
47 if (monitor == nullptr) {
48 return -1.0;
49 }
50
51 int refresh_rate = gdk_monitor_get_refresh_rate(monitor);
52 if (refresh_rate <= 0) {
53 return -1.0;
54 }
55
56 return static_cast<gdouble>(refresh_rate) / 1000.0;
57}
◆ fl_renderer_gdk_init()
static void fl_renderer_gdk_init |
( |
FlRendererGdk * |
self | ) |
|
|
static |
◆ fl_renderer_gdk_make_current()
static void fl_renderer_gdk_make_current |
( |
FlRenderer * |
renderer | ) |
|
|
static |
◆ fl_renderer_gdk_make_resource_current()
static void fl_renderer_gdk_make_resource_current |
( |
FlRenderer * |
renderer | ) |
|
|
static |
◆ fl_renderer_gdk_new()
FlRendererGdk * fl_renderer_gdk_new |
( |
GdkWindow * |
window | ) |
|
Definition at line 81 of file fl_renderer_gdk.cc.
81 {
83 FL_RENDERER_GDK(g_object_new(fl_renderer_gdk_get_type(), nullptr));
86}