Flutter Engine
mock_renderer.cc File Reference
#include "flutter/shell/platform/linux/testing/mock_renderer.h"

Go to the source code of this file.

Classes

struct  _FlMockRenderer
 

Functions

static EGLDisplay fl_mock_renderer_create_display (FlRenderer *renderer)
 
static gboolean fl_mock_renderer_create_surfaces (FlRenderer *renderer, GtkWidget *widget, EGLDisplay display, EGLConfig config, EGLSurface *visible, EGLSurface *resource, GError **error)
 
static void fl_mock_renderer_class_init (FlMockRendererClass *klass)
 
static void fl_mock_renderer_init (FlMockRenderer *self)
 
FlMockRenderer * fl_mock_renderer_new ()
 

Function Documentation

◆ fl_mock_renderer_class_init()

static void fl_mock_renderer_class_init ( FlMockRendererClass *  klass)
static

Definition at line 32 of file mock_renderer.cc.

References fl_mock_renderer_create_display(), and fl_mock_renderer_create_surfaces().

32  {
33  FL_RENDERER_CLASS(klass)->create_display = fl_mock_renderer_create_display;
34  FL_RENDERER_CLASS(klass)->create_surfaces = fl_mock_renderer_create_surfaces;
35 }
static gboolean fl_mock_renderer_create_surfaces(FlRenderer *renderer, GtkWidget *widget, EGLDisplay display, EGLConfig config, EGLSurface *visible, EGLSurface *resource, GError **error)
static EGLDisplay fl_mock_renderer_create_display(FlRenderer *renderer)

◆ fl_mock_renderer_create_display()

static EGLDisplay fl_mock_renderer_create_display ( FlRenderer *  renderer)
static

Definition at line 14 of file mock_renderer.cc.

References eglGetDisplay().

Referenced by fl_mock_renderer_class_init().

14  {
15  return eglGetDisplay(EGL_DEFAULT_DISPLAY);
16 }
EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
Definition: mock_egl.cc:248

◆ fl_mock_renderer_create_surfaces()

static gboolean fl_mock_renderer_create_surfaces ( FlRenderer *  renderer,
GtkWidget *  widget,
EGLDisplay  display,
EGLConfig  config,
EGLSurface *  visible,
EGLSurface *  resource,
GError **  error 
)
static

Definition at line 19 of file mock_renderer.cc.

References eglCreatePbufferSurface(), eglCreateWindowSurface(), and TRUE.

Referenced by fl_mock_renderer_class_init().

25  {
26  *visible = eglCreateWindowSurface(display, config, 0, nullptr);
27  const EGLint attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE};
28  *resource = eglCreatePbufferSurface(display, config, attribs);
29  return TRUE;
30 }
EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list)
Definition: mock_egl.cc:142
return TRUE
Definition: fl_view.cc:107
EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list)
Definition: mock_egl.cc:132

◆ fl_mock_renderer_init()

static void fl_mock_renderer_init ( FlMockRenderer *  self)
static

Definition at line 37 of file mock_renderer.cc.

37 {}

◆ fl_mock_renderer_new()

FlMockRenderer* fl_mock_renderer_new ( )

Definition at line 40 of file mock_renderer.cc.

Referenced by make_mock_engine().

40  {
41  return FL_MOCK_RENDERER(g_object_new(fl_mock_renderer_get_type(), nullptr));
42 }