Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
flutter_runner::testing::FakeFlatland Class Reference

#include <fake_flatland.h>

Inheritance diagram for flutter_runner::testing::FakeFlatland:

Public Types

using PresentHandler = std::function< void(fuchsia::ui::composition::PresentArgs)>
 

Public Member Functions

 FakeFlatland ()
 
 ~FakeFlatland () override
 
bool is_allocator_connected () const
 
bool is_flatland_connected () const
 
const std::string & debug_name () const
 
const FakeGraphgraph ()
 
fuchsia::ui::composition::AllocatorHandle ConnectAllocator (async_dispatcher_t *dispatcher=nullptr)
 
fuchsia::ui::composition::FlatlandHandle ConnectFlatland (async_dispatcher_t *dispatcher=nullptr)
 
void Disconnect (fuchsia::ui::composition::FlatlandError error)
 
void SetPresentHandler (PresentHandler present_handler)
 
void FireOnNextFrameBeginEvent (fuchsia::ui::composition::OnNextFrameBeginValues on_next_frame_begin_values)
 
void FireOnFramePresentedEvent (fuchsia::scenic::scheduling::FramePresentedInfo frame_presented_info)
 

Detailed Description

Definition at line 67 of file fake_flatland.h.

Member Typedef Documentation

◆ PresentHandler

using flutter_runner::testing::FakeFlatland::PresentHandler = std::function<void(fuchsia::ui::composition::PresentArgs)>

Definition at line 71 of file fake_flatland.h.

Constructor & Destructor Documentation

◆ FakeFlatland()

flutter_runner::testing::FakeFlatland::FakeFlatland ( )

Definition at line 16 of file fake_flatland.cc.

17 : allocator_binding_(this),
18 flatland_binding_(this),
19 present_handler_([](auto args) {}) {}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args

◆ ~FakeFlatland()

flutter_runner::testing::FakeFlatland::~FakeFlatland ( )
overridedefault

Member Function Documentation

◆ ConnectAllocator()

fuchsia::ui::composition::AllocatorHandle flutter_runner::testing::FakeFlatland::ConnectAllocator ( async_dispatcher_t *  dispatcher = nullptr)

Definition at line 23 of file fake_flatland.cc.

24 {
25 FML_CHECK(!allocator_binding_.is_bound());
26
27 fuchsia::ui::composition::AllocatorHandle allocator;
28 allocator_binding_.Bind(allocator.NewRequest(), dispatcher);
29
30 return allocator;
31}
#define FML_CHECK(condition)
Definition: logging.h:85

◆ ConnectFlatland()

fuchsia::ui::composition::FlatlandHandle flutter_runner::testing::FakeFlatland::ConnectFlatland ( async_dispatcher_t *  dispatcher = nullptr)

Definition at line 33 of file fake_flatland.cc.

34 {
35 FML_CHECK(!flatland_binding_.is_bound());
36
37 fuchsia::ui::composition::FlatlandHandle flatland;
38 flatland_binding_.Bind(flatland.NewRequest(), dispatcher);
39
40 return flatland;
41}

◆ debug_name()

const std::string & flutter_runner::testing::FakeFlatland::debug_name ( ) const
inline

Definition at line 81 of file fake_flatland.h.

81{ return debug_name_; }

◆ Disconnect()

void flutter_runner::testing::FakeFlatland::Disconnect ( fuchsia::ui::composition::FlatlandError  error)

Definition at line 43 of file fake_flatland.cc.

43 {
44 flatland_binding_.events().OnError(error);
45 flatland_binding_.Unbind();
46 allocator_binding_
47 .Unbind(); // TODO(fxb/85619): Does the real Scenic unbind this when
48 // Flatland has an error? Or is it independent?
49}
const uint8_t uint32_t uint32_t GError ** error

◆ FireOnFramePresentedEvent()

void flutter_runner::testing::FakeFlatland::FireOnFramePresentedEvent ( fuchsia::scenic::scheduling::FramePresentedInfo  frame_presented_info)

Definition at line 63 of file fake_flatland.cc.

64 {
65 flatland_binding_.events().OnFramePresented(std::move(frame_presented_info));
66}

◆ FireOnNextFrameBeginEvent()

void flutter_runner::testing::FakeFlatland::FireOnNextFrameBeginEvent ( fuchsia::ui::composition::OnNextFrameBeginValues  on_next_frame_begin_values)

Definition at line 56 of file fake_flatland.cc.

58 {
59 flatland_binding_.events().OnNextFrameBegin(
60 std::move(on_next_frame_begin_values));
61}

◆ graph()

const FakeGraph & flutter_runner::testing::FakeFlatland::graph ( )
inline

Definition at line 83 of file fake_flatland.h.

83{ return current_graph_; }

◆ is_allocator_connected()

bool flutter_runner::testing::FakeFlatland::is_allocator_connected ( ) const
inline

Definition at line 77 of file fake_flatland.h.

77{ return allocator_binding_.is_bound(); }

◆ is_flatland_connected()

bool flutter_runner::testing::FakeFlatland::is_flatland_connected ( ) const
inline

Definition at line 79 of file fake_flatland.h.

79{ return flatland_binding_.is_bound(); }

◆ SetPresentHandler()

void flutter_runner::testing::FakeFlatland::SetPresentHandler ( PresentHandler  present_handler)

Definition at line 51 of file fake_flatland.cc.

51 {
52 present_handler_ =
53 present_handler ? std::move(present_handler) : [](auto args) {};
54}

The documentation for this class was generated from the following files: