| Flutter Linux Embedder |

Functions | Variables
fl_compositor_opengl.h File Reference
`#include <gtk/gtk.h>`
`#include "flutter/shell/platform/embedder/embedder.h"`
`#include "flutter/shell/platform/linux/fl_compositor.h"`
`#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"`

Go to the source code of this file.

## Functions
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, int width, int height)
void | fl_compositor_opengl_cleanup (FlCompositorOpenGL *compositor)

## Variables
G_BEGIN_DECLS GdkGLContext * | context

## Function Documentation

## ◆ fl_compositor_opengl_cleanup()

void fl_compositor_opengl_cleanup | ( | FlCompositorOpenGL * | compositor | ) |

fl_compositor_opengl_cleanup: @compositor: an #FlCompositorOpenGL.

Removes OpenGL resources used for rendering. Requires an active context.

Definition at line 558 of file fl_compositor_opengl.cc.

558 {
559 g_return_if_fail(FL_IS_COMPOSITOR_OPENGL(self));
560
561 if (self->program != 0) {
562 glDeleteProgram(self->program);
563 }
564 if (self->vertex_buffer != 0) {
565 glDeleteBuffers(1, &self->vertex_buffer);
566 }
567 }

Referenced by unrealize_cb().

## ◆ fl_compositor_opengl_render()

void fl_compositor_opengl_render | ( | FlCompositorOpenGL * | compositor,
|  | int | width,
|  | int | height
| ) |  |

fl_compositor_opengl_render: @compositor: an #FlCompositorOpenGL. @width: width of the window in pixels. @height: height of the window in pixels.

Performs OpenGL commands to render current Flutter view.

Definition at line 545 of file fl_compositor_opengl.cc.

547 {
548 g_return_if_fail(FL_IS_COMPOSITOR_OPENGL(self));
549
550 glClearColor(0.0, 0.0, 0.0, 0.0);
551 glClear(GL_COLOR_BUFFER_BIT);
552
553 render(self, self->framebuffers, width, height);
554
555 glFlush();
556 }
render
static void render(FlCompositorOpenGL *self, GPtrArray *framebuffers, int width, int height)
Definition: fl_compositor_opengl.cc:289
height
const uint8_t uint32_t uint32_t * height
Definition: fl_pixel_buffer_texture_test.cc:39
width
const uint8_t uint32_t * width
Definition: fl_pixel_buffer_texture_test.cc:38

References height, render(), and width.

Referenced by render_cb(), and TEST().

## ◆ G_DECLARE_FINAL_TYPE()

G_BEGIN_DECLS G_DECLARE_FINAL_TYPE | ( | FlCompositorOpenGL | ,
|  | fl_compositor_opengl | ,
|  | FL | ,
|  | COMPOSITOR_OPENGL | ,
|  | FlCompositor |
| ) |  |

FlCompositorOpenGL:

#FlCompositorOpenGL is class that implements compositing using OpenGL. fl_compositor_opengl_new: @engine: an #FlEngine. @context: the OpenGL context that is being rendered into.

Creates a new OpenGL compositor.

Returns: a new #FlCompositorOpenGL.

## Variable Documentation

## ◆ context

G_BEGIN_DECLS GdkGLContext* context

Definition at line 38 of file fl_compositor_opengl.h.

Referenced by create_pango_layout(), fl_compositor_opengl_new(), and get_pango_context().