11 G_DEFINE_TYPE(FlCompositorSoftware, fl_compositor_software, G_TYPE_OBJECT)
14 FlCompositorSoftwareClass* klass) {}
19 return FL_COMPOSITOR_SOFTWARE(
20 g_object_new(fl_compositor_software_get_type(),
nullptr));
25 const FlutterLayer**
layers,
28 cairo_set_operator(cr, CAIRO_OPERATOR_CLEAR);
33 const FlutterLayer* layer =
layers[
i];
34 switch (layer->type) {
35 case kFlutterLayerContentTypeBackingStore: {
36 const FlutterBackingStore* backing_store = layer->backing_store;
37 g_assert(backing_store->type == kFlutterBackingStoreTypeSoftware);
39 cairo_surface_t* surface = cairo_image_surface_create_for_data(
40 static_cast<unsigned char*
>(
41 const_cast<void*
>(backing_store->software.allocation)),
42 CAIRO_FORMAT_ARGB32, backing_store->software.row_bytes / 4,
43 backing_store->software.height, backing_store->software.row_bytes);
48 cairo_rectangle(cr, layer->offset.x, layer->offset.y, layer->size.width,
51 cairo_set_source_surface(cr, surface, layer->offset.x, layer->offset.y);
55 cairo_surface_destroy(surface);
57 case kFlutterLayerContentTypePlatformView: {
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
FlCompositorSoftware * fl_compositor_software_new()
gboolean fl_compositor_software_composite_layers(FlCompositorSoftware *self, cairo_t *cr, const FlutterLayer **layers, size_t layers_count)
static void fl_compositor_software_class_init(FlCompositorSoftwareClass *klass)
static void fl_compositor_software_init(FlCompositorSoftware *self)
const FlutterLayer size_t layers_count
const FlutterLayer ** layers