| 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 <cairo.h>
9 #include <gdk/gdk.h>
10
11 #include "flutter/shell/platform/embedder/embedder.h"
12
13 G_BEGIN_DECLS
14
15 G_DECLARE_DERIVABLE_TYPE(FlCompositor, fl_compositor, FL, COMPOSITOR, GObject)
16
17 struct _FlCompositorClass {
18 GObjectClass parent_class;
19
20 gboolean (*present_layers)(FlCompositor* compositor,
21 const FlutterLayer** layers,
22 size_t layers_count);
23
24 gboolean (*render)(FlCompositor* compositor, cairo_t* cr, GdkWindow* window);
25 };
26
27 /**
28 * FlCompositor:
29 *
30 * #FlCompositor is an abstract class that implements Flutter compositing.
31 */
32
33 /**
34 * fl_compositor_present_layers:
35 * @compositor: an #FlCompositor.
36 * @layers: layers to be composited.
37 * @layers_count: number of layers.
38 *
39 * Composite layers. Called from the Flutter rendering thread.
40 *
41 * Returns %TRUE if successful.
42 */
43 gboolean fl_compositor_present_layers(FlCompositor* compositor,
44 const FlutterLayer** layers,
45 size_t layers_count);
46
47 /**
48 * fl_compositor_render:
49 * @compositor: an #FlCompositor.
50 * @cr: a Cairo rendering context.
51 * @window: window being rendered into.
52 *
53 * Renders the current frame. Called from the GTK thread.
54 *
55 * Returns %TRUE if successful.
56 */
57 gboolean fl_compositor_render(FlCompositor* compositor,
58 cairo_t* cr,
59 GdkWindow* window);
60
61 G_END_DECLS
62
63 #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)
window
return window
Definition: fl_application.cc:41
FL
FL
Definition: fl_binary_messenger.cc:27
fl_compositor_render
gboolean fl_compositor_render(FlCompositor *compositor, cairo_t *cr, GdkWindow *window)
Definition: fl_compositor.cc:23
fl_compositor_present_layers
gboolean fl_compositor_present_layers(FlCompositor *compositor, const FlutterLayer **layers, size_t layers_count)
Definition: fl_compositor.cc:15
layers_count
const FlutterLayer size_t layers_count
Definition: fl_compositor_software.cc:33
layers
const FlutterLayer ** layers
Definition: fl_compositor_software.cc:32
_FlCompositorClass
Definition: fl_compositor.h:17
_FlCompositorClass::parent_class
GObjectClass parent_class
Definition: fl_compositor.h:18