| 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"
8 #include "flutter/shell/platform/linux/fl_compositor_software.h"
9 #include "flutter/shell/platform/linux/public/flutter_linux/fl_dart_project.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 }
fl_compositor_present_layers
gboolean fl_compositor_present_layers(FlCompositor *self, const FlutterLayer **layers, size_t layers_count)
Definition: fl_compositor.cc:29
fl_compositor_software_render
gboolean fl_compositor_software_render(FlCompositorSoftware *self, cairo_t *cr, gint scale_factor)
Definition: fl_compositor_software.cc:93
fl_compositor_software_new
FlCompositorSoftware * fl_compositor_software_new()
Definition: fl_compositor_software.cc:87
fl_compositor_software.h
TEST
TEST(FlCompositorSoftwareTest, Render)
Definition: fl_compositor_software_test.cc:12
fl_dart_project_new
G_MODULE_EXPORT FlDartProject * fl_dart_project_new()
Definition: fl_dart_project.cc:52
fl_dart_project.h