Flutter Linux Embedder
fl_compositor_software_test.cc
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 #include "gtest/gtest.h"
6 
7 #include "flutter/common/constants.h"
10 #include "flutter/shell/platform/linux/testing/mock_renderable.h"
11 
12 TEST(FlCompositorSoftwareTest, Render) {
13  g_autoptr(FlDartProject) project = fl_dart_project_new();
14 
15  g_autoptr(FlCompositorSoftware) compositor = fl_compositor_software_new();
16 
17  unsigned char image_data[1024 * 1024 * 4];
18  cairo_surface_t* surface = cairo_image_surface_create_for_data(
19  image_data, CAIRO_FORMAT_ARGB32, 1024, 1024, 1024 * 4);
20  cairo_t* cr = cairo_create(surface);
21  fl_compositor_present_layers(FL_COMPOSITOR(compositor), nullptr, 0);
22  fl_compositor_software_render(compositor, cr, 1);
23  cairo_surface_destroy(surface);
24 }
gboolean fl_compositor_present_layers(FlCompositor *self, const FlutterLayer **layers, size_t layers_count)
gboolean fl_compositor_software_render(FlCompositorSoftware *self, cairo_t *cr, gint scale_factor)
FlCompositorSoftware * fl_compositor_software_new()
TEST(FlCompositorSoftwareTest, Render)
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()