Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
fl_compositor_software.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_SOFTWARE_H_
6#define FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_SOFTWARE_H_
7
8#include <cairo/cairo.h>
9#include <glib-object.h>
10
12
13G_BEGIN_DECLS
14
15G_DECLARE_FINAL_TYPE(FlCompositorSoftware,
16 fl_compositor_software,
17 FL,
18 COMPOSITOR_SOFTWARE,
19 GObject)
20
21/**
22 * FlCompositorSoftware:
23 *
24 * #FlCompositorSoftware is a class that implements compositing using software
25 * rendering.
26 *
27 * The composited frame is stored in a Cairo image surface.
28 */
29
30/**
31 * fl_compositor_software_new:
32 *
33 * Creates a new software rendering compositor.
34 *
35 * Returns: a new #FlCompositorSoftware.
36 */
37FlCompositorSoftware* fl_compositor_software_new();
38
39/**
40 * fl_compositor_software_composite_layers:
41 * @compositor: an #FlCompositorSoftware.
42 * @layers: layers to be composited. Each layer must be a backing store layer
43 * (%kFlutterLayerContentTypeBackingStore) backed by a software backing store
44 * (%kFlutterBackingStoreTypeSoftware).
45 * @layers_count: number of layers.
46 *
47 * Combines and stores the provided layers as the current frame.
48 *
49 * Returns %TRUE if successful.
50 */
52 FlCompositorSoftware* compositor,
53 const FlutterLayer** layers,
54 size_t layers_count);
55
56/**
57 * fl_compositor_software_get_frame_size:
58 * @compositor: an #FlCompositorSoftware.
59 * @width: location to write frame width in pixels.
60 * @height: location to write frame height in pixels.
61 *
62 * Get the size of the stored frame. The size is zero if there is no frame yet.
63 */
64void fl_compositor_software_get_frame_size(FlCompositorSoftware* compositor,
65 size_t* width,
66 size_t* height);
67
68/**
69 * fl_compositor_software_render:
70 * @compositor: an #FlCompositorSoftware.
71 * @cr: a Cairo rendering context.
72 * @scale_factor: the device scale factor to render at.
73 *
74 * Renders the stored frame.
75 *
76 * Returns %TRUE if successful.
77 */
78gboolean fl_compositor_software_render(FlCompositorSoftware* compositor,
79 cairo_t* cr,
80 gint scale_factor);
81
82G_END_DECLS
83
84#endif // FLUTTER_SHELL_PLATFORM_LINUX_FL_COMPOSITOR_SOFTWARE_H_
FlCompositorSoftware * fl_compositor_software_new()
void fl_compositor_software_get_frame_size(FlCompositorSoftware *compositor, size_t *width, size_t *height)
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(FlCompositorSoftware, fl_compositor_software, FL, COMPOSITOR_SOFTWARE, GObject) FlCompositorSoftware *fl_compositor_software_new()
gboolean fl_compositor_software_render(FlCompositorSoftware *compositor, cairo_t *cr, gint scale_factor)
gboolean fl_compositor_software_composite_layers(FlCompositorSoftware *compositor, const FlutterLayer **layers, size_t layers_count)
const FlutterLayer size_t layers_count
const FlutterLayer ** layers
int32_t height
int32_t width