Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Public Attributes | List of all members
flutter_runner::testing::FakeGraph Struct Reference

#include <fake_flatland_types.h>

Public Types

using ContentIdKey = decltype(fuchsia::ui::composition::ContentId::value)
 
using TransformIdKey = decltype(fuchsia::ui::composition::TransformId::value)
 

Public Member Functions

bool operator== (const FakeGraph &other) const
 
void Clear ()
 
FakeGraph Clone () const
 

Public Attributes

std::unordered_map< ContentIdKey, std::shared_ptr< FakeContent > > content_map
 
std::unordered_map< TransformIdKey, std::shared_ptr< FakeTransform > > transform_map
 
std::shared_ptr< FakeTransformroot_transform
 
std::optional< FakeViewview
 

Detailed Description

Definition at line 249 of file fake_flatland_types.h.

Member Typedef Documentation

◆ ContentIdKey

Definition at line 250 of file fake_flatland_types.h.

◆ TransformIdKey

Definition at line 251 of file fake_flatland_types.h.

Member Function Documentation

◆ Clear()

void flutter_runner::testing::FakeGraph::Clear ( )

Definition at line 148 of file fake_flatland_types.cc.

148 {
149 view.reset();
150 root_transform.reset();
151 transform_map.clear();
152 content_map.clear();
153}
std::unordered_map< ContentIdKey, std::shared_ptr< FakeContent > > content_map
std::shared_ptr< FakeTransform > root_transform
std::unordered_map< TransformIdKey, std::shared_ptr< FakeTransform > > transform_map

◆ Clone()

FakeGraph flutter_runner::testing::FakeGraph::Clone ( ) const

Definition at line 155 of file fake_flatland_types.cc.

155 {
156 FakeGraph clone;
157 FakeTransformCache transform_cache;
158
159 for (const auto& [transform_id, transform] : transform_map) {
161 clone.transform_map.emplace(transform_id,
162 CloneFakeTransform(transform, transform_cache));
163 }
164 for (const auto& [content_id, content] : content_map) {
166 clone.content_map.emplace(content_id, CloneFakeContent(content));
167 }
168 if (root_transform) {
169 auto found_transform = transform_cache.find(root_transform.get());
170 FML_CHECK(found_transform != transform_cache.end());
171 clone.root_transform = found_transform->second;
172 }
173 if (view.has_value()) {
174 clone.view.emplace(view.value());
175 }
176
177 return clone;
178}
#define FML_CHECK(condition)
Definition: logging.h:85
union flutter::testing::@2836::KeyboardChange::@76 content
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47

◆ operator==()

bool flutter_runner::testing::FakeGraph::operator== ( const FakeGraph other) const

Definition at line 142 of file fake_flatland_types.cc.

142 {
143 return transform_map == other.transform_map &&
144 content_map == other.content_map &&
145 root_transform == other.root_transform && view == other.view;
146}

Member Data Documentation

◆ content_map

std::unordered_map<ContentIdKey, std::shared_ptr<FakeContent> > flutter_runner::testing::FakeGraph::content_map

Definition at line 258 of file fake_flatland_types.h.

◆ root_transform

std::shared_ptr<FakeTransform> flutter_runner::testing::FakeGraph::root_transform

Definition at line 261 of file fake_flatland_types.h.

◆ transform_map

std::unordered_map<TransformIdKey, std::shared_ptr<FakeTransform> > flutter_runner::testing::FakeGraph::transform_map

Definition at line 260 of file fake_flatland_types.h.

◆ view

std::optional<FakeView> flutter_runner::testing::FakeGraph::view

Definition at line 262 of file fake_flatland_types.h.


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