Flutter Linux Embedder
fl_compositor_opengl.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_OPENGL_H_
6 #define FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_OPENGL_H_
7 
8 #include <gtk/gtk.h>
9 
10 #include "flutter/shell/platform/embedder/embedder.h"
13 
14 G_BEGIN_DECLS
15 
16 G_DECLARE_FINAL_TYPE(FlCompositorOpenGL,
17  fl_compositor_opengl,
18  FL,
19  COMPOSITOR_OPENGL,
20  FlCompositor)
21 
22 /**
23  * FlCompositorOpenGL:
24  *
25  * #FlCompositorOpenGL is an abstract class that allows Flutter to draw pixels.
26  */
27 
28 /**
29  * fl_compositor_opengl_new:
30  * @engine: an #FlEngine.
31  *
32  * Creates a new OpenGL compositor.
33  *
34  * Returns: a new #FlCompositorOpenGL.
35  */
36 FlCompositorOpenGL* fl_compositor_opengl_new(FlEngine* engine);
37 
38 /**
39  * fl_compositor_opengl_setup:
40  * @compositor: an #FlCompositorOpenGL.
41  *
42  * Creates OpenGL resources required before rendering. Requires an active
43  * context.
44  */
45 void fl_compositor_opengl_setup(FlCompositorOpenGL* compositor);
46 
47 /**
48  * fl_compositor_opengl_render:
49  * @compositor: an #FlCompositorOpenGL.
50  * @view_id: view to render.
51  * @width: width of the window in pixels.
52  * @height: height of the window in pixels.
53  * @background_color: color to use for background.
54  *
55  * Performs OpenGL commands to render current Flutter view.
56  */
57 void fl_compositor_opengl_render(FlCompositorOpenGL* compositor,
58  FlutterViewId view_id,
59  int width,
60  int height,
61  const GdkRGBA* background_color);
62 
63 /**
64  * fl_compositor_opengl_cleanup:
65  * @compositor: an #FlCompositorOpenGL.
66  *
67  * Removes OpenGL resources used for rendering. Requires an active
68  * context.
69  */
70 void fl_compositor_opengl_cleanup(FlCompositorOpenGL* compositor);
71 
72 G_END_DECLS
73 
74 #endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_OPENGL_H_
FlCompositorOpenGL * fl_compositor_opengl_new(FlEngine *engine)
void fl_compositor_opengl_setup(FlCompositorOpenGL *compositor)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlCompositorOpenGL, fl_compositor_opengl, FL, COMPOSITOR_OPENGL, FlCompositor) FlCompositorOpenGL *fl_compositor_opengl_new(FlEngine *engine)
void fl_compositor_opengl_render(FlCompositorOpenGL *compositor, FlutterViewId view_id, int width, int height, const GdkRGBA *background_color)
void fl_compositor_opengl_cleanup(FlCompositorOpenGL *compositor)
const uint8_t uint32_t uint32_t * height
const uint8_t uint32_t * width
G_BEGIN_DECLS FlutterViewId view_id