| Flutter Linux Embedder |

fl_compositor.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_H_
7
8 #include <glib-object.h>
9
10 #include "flutter/shell/platform/embedder/embedder.h"
11
12 G_BEGIN_DECLS
13
14 G_DECLARE_DERIVABLE_TYPE(FlCompositor, fl_compositor, FL, COMPOSITOR, GObject)
15
16 struct _FlCompositorClass {
17 GObjectClass parent_class;
18
19 FlutterRendererType (*get_renderer_type)(FlCompositor* compositor);
20
21 gboolean (*present_layers)(FlCompositor* compositor,
22 const FlutterLayer** layers,
23 size_t layers_count);
24
25 void (*wait_for_frame)(FlCompositor* compositor,
26 int target_width,
27 int target_height);
28 };
29
30 /**
31 * FlCompositor:
32 *
33 * #FlCompositor is an abstract class that implements Flutter compositing.
34 */
35
36 /**
37 * fl_compositor_get_renderer_type:
38 * @compositor: an #FlCompositor.
39 *
40 * Gets the rendering method this compositor uses.
41 *
42 * Returns: a FlutterRendererType.
43 */
44 FlutterRendererType fl_compositor_get_renderer_type(FlCompositor* compositor);
45
46 /**
47 * fl_compositor_present_layers:
48 * @compositor: an #FlCompositor.
49 * @layers: layers to be composited.
50 * @layers_count: number of layers.
51 *
52 * Callback invoked by the engine to composite the contents of each layer
53 * onto the screen.
54 *
55 * Returns %TRUE if successful.
56 */
57 gboolean fl_compositor_present_layers(FlCompositor* compositor,
58 const FlutterLayer** layers,
59 size_t layers_count);
60
61 /**
62 * fl_compositor_wait_for_frame:
63 * @compositor: an #FlCompositor.
64 * @target_width: width of frame being waited for
65 * @target_height: height of frame being waited for
66 *
67 * Holds the thread until frame with requested dimensions is presented.
68 * While waiting for frame Flutter platform and raster tasks are being
69 * processed.
70 */
71 void fl_compositor_wait_for_frame(FlCompositor* compositor,
72 int target_width,
73 int target_height);
74
75 G_END_DECLS
76
77 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_H_
G_DECLARE_DERIVABLE_TYPE
G_BEGIN_DECLS G_DECLARE_DERIVABLE_TYPE(FlAccessibleNode, fl_accessible_node, FL, ACCESSIBLE_NODE, AtkObject)
FL
FL
Definition: fl_binary_messenger.cc:27
fl_compositor_get_renderer_type
FlutterRendererType fl_compositor_get_renderer_type(FlCompositor *compositor)
Definition: fl_compositor.cc:15
fl_compositor_wait_for_frame
void fl_compositor_wait_for_frame(FlCompositor *compositor, int target_width, int target_height)
Definition: fl_compositor.cc:21
fl_compositor_present_layers
gboolean fl_compositor_present_layers(FlCompositor *compositor, const FlutterLayer **layers, size_t layers_count)
Definition: fl_compositor.cc:29
present_layers
static gboolean present_layers(FlCompositorOpenGL *self, const FlutterLayer **layers, size_t layers_count)
Definition: fl_compositor_opengl.cc:300
_FlCompositorClass
Definition: fl_compositor.h:16
_FlCompositorClass::parent_class
GObjectClass parent_class
Definition: fl_compositor.h:17