Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
fl_compositor.h File Reference
#include <cairo.h>
#include <gdk/gdk.h>
#include "flutter/shell/platform/embedder/embedder.h"

Go to the source code of this file.

Classes

struct  _FlCompositorClass
 

Functions

gboolean fl_compositor_present_layers (FlCompositor *compositor, const FlutterLayer **layers, size_t layers_count)
 
void fl_compositor_get_frame_size (FlCompositor *compositor, size_t *width, size_t *height)
 
gboolean fl_compositor_render (FlCompositor *compositor, cairo_t *cr, GdkWindow *window, gboolean wait_for_frame)
 

Variables

G_BEGIN_DECLS constexpr gint64 kCompositorRenderTimeoutMicroseconds = 100000
 

Function Documentation

◆ fl_compositor_get_frame_size()

void fl_compositor_get_frame_size ( FlCompositor *  compositor,
size_t *  width,
size_t *  height 
)

fl_compositor_get_frame_size: @compositor: an #FlCompositor. @width: location to write frame width in pixels. @height: location to write frame height in pixels.

Get the size of the layer ready for rendering.

Definition at line 23 of file fl_compositor.cc.

25 {
26 g_return_if_fail(FL_IS_COMPOSITOR(self));
27 return FL_COMPOSITOR_GET_CLASS(self)->get_frame_size(self, width, height);
28}
int32_t height
int32_t width

References height, self, and width.

Referenced by G_DEFINE_TYPE_WITH_CODE(), TEST(), and TEST().

◆ fl_compositor_present_layers()

gboolean fl_compositor_present_layers ( FlCompositor *  compositor,
const FlutterLayer **  layers,
size_t  layers_count 
)

FlCompositor:

#FlCompositor is an abstract class that implements Flutter compositing. fl_compositor_present_layers: @compositor: an #FlCompositor. @layers: layers to be composited. @layers_count: number of layers.

Composite layers. Called from the Flutter rendering thread.

Returns TRUE if successful.

Definition at line 15 of file fl_compositor.cc.

17 {
18 g_return_val_if_fail(FL_IS_COMPOSITOR(self), FALSE);
19 return FL_COMPOSITOR_GET_CLASS(self)->present_layers(self, layers,
21}
const FlutterLayer size_t layers_count
const FlutterLayer ** layers

References layers, layers_count, and self.

Referenced by fl_view_present_layers(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ fl_compositor_render()

gboolean fl_compositor_render ( FlCompositor *  compositor,
cairo_t *  cr,
GdkWindow *  window,
gboolean  wait_for_frame 
)

fl_compositor_render: @compositor: an #FlCompositor. @cr: a Cairo rendering context. @window: window being rendered into. @wait_for_frame: if the available frame is not the size of the window block until a new frame is received.

Renders the current frame. Called from the GTK thread.

Returns TRUE if successful.

Definition at line 30 of file fl_compositor.cc.

33 {
34 g_return_val_if_fail(FL_IS_COMPOSITOR(self), FALSE);
35 return FL_COMPOSITOR_GET_CLASS(self)->render(self, cr, window,
36 wait_for_frame);
37}
GLFWwindow * window
Definition main.cc:60

References self, and window.

Referenced by draw_cb(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

Variable Documentation

◆ kCompositorRenderTimeoutMicroseconds

G_BEGIN_DECLS constexpr gint64 kCompositorRenderTimeoutMicroseconds = 100000
constexpr

Definition at line 16 of file fl_compositor.h.

Referenced by fl_compositor_opengl_render(), and fl_compositor_software_render().