Flutter Engine
mock_renderer.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 "flutter/shell/platform/linux/testing/mock_renderer.h"
6 
8  FlRenderer parent_instance;
9 };
10 
11 G_DEFINE_TYPE(FlMockRenderer, fl_mock_renderer, fl_renderer_get_type())
12 
13 // Implements FlRenderer::create_contexts.
14 static gboolean fl_mock_renderer_create_contexts(FlRenderer* renderer,
15  GtkWidget* widget,
16  GdkGLContext** visible,
17  GdkGLContext** resource,
18  GError** error) {
19  return TRUE;
20 }
21 
22 // Implements FlRenderer::create_backing_store.
24  FlRenderer* renderer,
25  const FlutterBackingStoreConfig* config,
26  FlutterBackingStore* backing_store_out) {
27  return TRUE;
28 }
29 
30 // Implements FlRenderer::collect_backing_store.
32  FlRenderer* self,
33  const FlutterBackingStore* backing_store) {
34  return TRUE;
35 }
36 
37 // Implements FlRenderer::present_layers.
38 static gboolean fl_mock_renderer_present_layers(FlRenderer* self,
39  const FlutterLayer** layers,
40  size_t layers_count) {
41  return TRUE;
42 }
43 
44 static void fl_mock_renderer_class_init(FlMockRendererClass* klass) {
45  FL_RENDERER_CLASS(klass)->create_contexts = fl_mock_renderer_create_contexts;
46  FL_RENDERER_CLASS(klass)->create_backing_store =
48  FL_RENDERER_CLASS(klass)->collect_backing_store =
50  FL_RENDERER_CLASS(klass)->present_layers = fl_mock_renderer_present_layers;
51 }
52 
53 static void fl_mock_renderer_init(FlMockRenderer* self) {}
54 
55 // Creates a stub renderer
56 FlMockRenderer* fl_mock_renderer_new() {
57  return FL_MOCK_RENDERER(g_object_new(fl_mock_renderer_get_type(), nullptr));
58 }
static gboolean fl_mock_renderer_present_layers(FlRenderer *self, const FlutterLayer **layers, size_t layers_count)
const uint8_t uint32_t uint32_t GError ** error
FlMockRenderer * fl_mock_renderer_new()
static gboolean fl_mock_renderer_collect_backing_store(FlRenderer *self, const FlutterBackingStore *backing_store)
static gboolean fl_mock_renderer_create_backing_store(FlRenderer *renderer, const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out)
static void fl_mock_renderer_class_init(FlMockRendererClass *klass)
FlRenderer parent_instance
Definition: mock_renderer.cc:8
static void fl_mock_renderer_init(FlMockRenderer *self)
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle, fl_basic_message_channel_response_handle, G_TYPE_OBJECT) static void fl_basic_message_channel_response_handle_dispose(GObject *object)
static gboolean fl_mock_renderer_create_contexts(FlRenderer *renderer, GtkWidget *widget, GdkGLContext **visible, GdkGLContext **resource, GError **error)