| Flutter Linux Embedder |

fl_framebuffer.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_FRAMEBUFFER_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_FRAMEBUFFER_H_
7
8 #include <epoxy/gl.h>
9 #include <glib-object.h>
10
11 G_BEGIN_DECLS
12
13 G_DECLARE_FINAL_TYPE(FlFramebuffer, fl_framebuffer, FL, FRAMEBUFFER, GObject)
14
15 /**
16 * FlFramebuffer:
17 *
18 * #FlFramebuffer creates framebuffers and their backing textures
19 * for use by the Flutter compositor.
20 */
21
22 /**
23 * fl_framebuffer_new:
24 * @format: format, e.g. GL_RGB, GL_BGR
25 * @width: width of texture.
26 * @height: height of texture.
27 * @shareable: %TRUE if this framebuffer can be shared between contexts
28 * (requires EGL).
29 *
30 * Creates a new frame buffer. Requires a valid OpenGL context to create.
31 *
32 * Returns: a new #FlFramebuffer.
33 */
34 FlFramebuffer* fl_framebuffer_new(GLint format,
35 size_t width,
36 size_t height,
37 gboolean shareable);
38
39 /**
40 * fl_framebuffer_get_shareable:
41 * @framebuffer: an #FlFramebuffer.
42 *
43 * Checks if this framebuffer can be shared between contexts (using
44 * fl_framebuffer_create_sibling).
45 *
46 * Returns: %TRUE if this framebuffer can be shared.
47 */
48 gboolean fl_framebuffer_get_shareable(FlFramebuffer* framebuffer);
49
50 /**
51 * fl_framebuffer_create_sibling:
52 * @framebuffer: an #FlFramebuffer.
53 *
54 * Creates a new framebuffer with the same backing texture as the original. This
55 * uses EGLImage to share the texture and allows a framebuffer created in one
56 * OpenGL context to be used in another.
57 *
58 * Returns: a new #FlFramebuffer.
59 */
60 FlFramebuffer* fl_framebuffer_create_sibling(FlFramebuffer* framebuffer);
61
62 /**
63 * fl_framebuffer_get_id:
64 * @framebuffer: an #FlFramebuffer.
65 *
66 * Gets the ID for this framebuffer.
67 *
68 * Returns: OpenGL framebuffer id or 0 if creation failed.
69 */
70 GLuint fl_framebuffer_get_id(FlFramebuffer* framebuffer);
71
72 /**
73 * fl_framebuffer_get_texture_id:
74 * @framebuffer: an #FlFramebuffer.
75 *
76 * Gets the ID of the texture associated with this framebuffer.
77 *
78 * Returns: OpenGL texture id or 0 if creation failed.
79 */
80 GLuint fl_framebuffer_get_texture_id(FlFramebuffer* framebuffer);
81
82 /**
83 * fl_framebuffer_get_width:
84 * @framebuffer: an #FlFramebuffer.
85 *
86 * Gets the width of the framebuffer in pixels.
87 *
88 * Returns: width in pixels.
89 */
90 size_t fl_framebuffer_get_width(FlFramebuffer* framebuffer);
91
92 /**
93 * fl_framebuffer_get_height:
94 * @framebuffer: an #FlFramebuffer.
95 *
96 * Gets the height of the framebuffer in pixels.
97 *
98 * Returns: height in pixels.
99 */
100 size_t fl_framebuffer_get_height(FlFramebuffer* framebuffer);
101
102 G_END_DECLS
103
104 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_FRAMEBUFFER_H_
G_DECLARE_FINAL_TYPE
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlAccessibleTextField, fl_accessible_text_field, FL, ACCESSIBLE_TEXT_FIELD, FlAccessibleNode)
FL
FL
Definition: fl_binary_messenger.cc:27
shareable
G_BEGIN_DECLS gboolean shareable
Definition: fl_compositor_opengl.h:40
height
self height
Definition: fl_compositor_software.cc:43
width
self width
Definition: fl_compositor_software.cc:42
fl_framebuffer_get_height
size_t fl_framebuffer_get_height(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:160
fl_framebuffer_create_sibling
FlFramebuffer * fl_framebuffer_create_sibling(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:120
fl_framebuffer_new
G_BEGIN_DECLS FlFramebuffer * fl_framebuffer_new(GLint format, size_t width, size_t height, gboolean shareable)
Definition: fl_framebuffer.cc:69
fl_framebuffer_get_shareable
gboolean fl_framebuffer_get_shareable(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:115
fl_framebuffer_get_width
size_t fl_framebuffer_get_width(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:156
fl_framebuffer_get_texture_id
GLuint fl_framebuffer_get_texture_id(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:152
fl_framebuffer_get_id
GLuint fl_framebuffer_get_id(FlFramebuffer *framebuffer)
Definition: fl_framebuffer.cc:148
format
uint32_t uint32_t * format
Definition: fl_texture_registrar_test.cc:42