7#include <zircon/types.h>
17 : allocator_binding_(this),
18 flatland_binding_(this),
19 present_handler_([](auto
args) {}) {}
24 async_dispatcher_t* dispatcher) {
25 FML_CHECK(!allocator_binding_.is_bound());
27 fuchsia::ui::composition::AllocatorHandle allocator;
28 allocator_binding_.Bind(allocator.NewRequest(), dispatcher);
34 async_dispatcher_t* dispatcher) {
37 fuchsia::ui::composition::FlatlandHandle flatland;
38 flatland_binding_.Bind(flatland.NewRequest(), dispatcher);
44 flatland_binding_.events().OnError(
error);
45 flatland_binding_.Unbind();
53 present_handler ? std::move(present_handler) : [](
auto args) {};
57 fuchsia::ui::composition::OnNextFrameBeginValues
58 on_next_frame_begin_values) {
59 flatland_binding_.events().OnNextFrameBegin(
60 std::move(on_next_frame_begin_values));
64 fuchsia::scenic::scheduling::FramePresentedInfo frame_presented_info) {
65 flatland_binding_.events().OnFramePresented(std::move(frame_presented_info));
68void FakeFlatland::NotImplemented_(
const std::string&
name) {
69 FML_LOG(FATAL) <<
"FakeFlatland does not implement " <<
name;
72void FakeFlatland::RegisterBufferCollection(
73 fuchsia::ui::composition::RegisterBufferCollectionArgs
args,
74 RegisterBufferCollectionCallback
callback) {
75 auto [export_token_koid, _] =
GetKoids(
args.export_token());
78 ZX_ASSERT(!
args.has_buffer_collection_token2() ||
79 !
args.has_buffer_collection_token());
80 fuchsia::sysmem2::BufferCollectionTokenHandle sysmem_token;
81 if (
args.has_buffer_collection_token2()) {
82 sysmem_token = std::move(*
args.mutable_buffer_collection_token2());
84 sysmem_token = fuchsia::sysmem2::BufferCollectionTokenHandle(
85 args.mutable_buffer_collection_token()->TakeChannel());
88 auto [__, emplace_binding_success] =
89 graph_bindings_.buffer_collections.emplace(
91 BufferCollectionBinding{
92 .export_token = std::move(*
args.mutable_export_token()),
93 .sysmem_token = std::move(sysmem_token),
94 .usage =
args.usage(),
98 <<
"FakeFlatland::RegisterBufferCollection: BufferCollection already "
100 << export_token_koid;
103void FakeFlatland::Present(fuchsia::ui::composition::PresentArgs
args) {
109 current_graph_ = pending_graph_.
Clone();
111 present_handler_(std::move(
args));
114void FakeFlatland::CreateView(
115 fuchsia::ui::views::ViewCreationToken token,
116 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
117 parent_viewport_watcher) {
118 CreateView2(std::move(token), fuchsia::ui::views::ViewIdentityOnCreation{},
119 fuchsia::ui::composition::ViewBoundProtocols{},
120 std::move(parent_viewport_watcher));
123void FakeFlatland::CreateView2(
124 fuchsia::ui::views::ViewCreationToken token,
125 fuchsia::ui::views::ViewIdentityOnCreation view_identity,
126 fuchsia::ui::composition::ViewBoundProtocols view_protocols,
127 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
128 parent_viewport_watcher) {
131 FML_CHECK(!graph_bindings_.viewport_watcher.has_value());
133 auto view_token_koids =
GetKoids(token);
134 auto view_ref_koids =
GetKoids(view_identity.view_ref);
135 auto view_ref_control_koids =
GetKoids(view_identity.view_ref_control);
136 FML_CHECK(view_ref_koids.first == view_ref_control_koids.second);
137 FML_CHECK(view_ref_koids.second == view_ref_control_koids.first);
139 pending_graph_.
view.emplace(FakeView{
140 .view_token = view_token_koids.first,
141 .view_ref = view_ref_koids.first,
142 .view_ref_control = view_ref_control_koids.first,
144 view_protocols.has_view_ref_focused()
145 ?
GetKoids(view_protocols.view_ref_focused()).first
147 .focuser = view_protocols.has_view_focuser()
148 ?
GetKoids(view_protocols.view_focuser()).first
150 .touch_source = view_protocols.has_touch_source()
151 ?
GetKoids(view_protocols.touch_source()).first
153 .mouse_source = view_protocols.has_mouse_source()
154 ?
GetKoids(view_protocols.mouse_source()).first
156 .parent_viewport_watcher =
GetKoids(parent_viewport_watcher).first,
158 graph_bindings_.viewport_watcher.emplace(
159 view_token_koids.first,
160 ParentViewportWatcher(
161 std::move(token), std::move(view_identity), std::move(view_protocols),
162 std::move(parent_viewport_watcher), flatland_binding_.dispatcher()));
165void FakeFlatland::CreateTransform(
166 fuchsia::ui::composition::TransformId transform_id) {
167 if (transform_id.value == 0) {
170 <<
"FakeFlatland::CreateTransform: TransformId 0 is invalid.";
173 if (pending_graph_.
transform_map.count(transform_id.value) != 0) {
175 FML_CHECK(
false) <<
"FakeFlatland::CreateTransform: TransformId "
176 << transform_id.value <<
" is already in use.";
180 auto [emplaced_transform, emplace_success] =
182 transform_id.value, std::make_shared<FakeTransform>(FakeTransform{
187 <<
"FakeFlatland::CreateTransform: Internal error (transform_map) adding "
188 "transform with id: "
189 << transform_id.value;
191 auto [_, emplace_parent_success] = parents_map_.emplace(
193 std::make_pair(std::weak_ptr<FakeTransform>(),
194 std::weak_ptr(emplaced_transform->second)));
197 <<
"FakeFlatland::CreateTransform: Internal error (parent_map) adding "
198 "transform with id: "
199 << transform_id.value;
202void FakeFlatland::SetTranslation(
203 fuchsia::ui::composition::TransformId transform_id,
204 fuchsia::math::Vec translation) {
205 if (transform_id.value == 0) {
208 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
212 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
215 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
216 << transform_id.value <<
" does not exist.";
220 auto&
transform = found_transform->second;
225void FakeFlatland::SetScale(fuchsia::ui::composition::TransformId transform_id,
226 fuchsia::math::VecF scale) {
227 if (transform_id.value == 0) {
229 FML_CHECK(
false) <<
"FakeFlatland::SetScale: TransformId 0 is invalid.";
233 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
236 FML_CHECK(
false) <<
"FakeFlatland::SetScale: TransformId "
237 << transform_id.value <<
" does not exist.";
241 if (scale.x == 0.f || scale.y == 0.f) {
242 FML_CHECK(
false) <<
"SetScale failed, zero values not allowed (" << scale.x
243 <<
", " << scale.y <<
" ).";
247 if (isinf(scale.x) || isinf(scale.y) || isnan(scale.x) || isnan(scale.y)) {
248 FML_CHECK(
false) <<
"SetScale failed, invalid scale values (" << scale.x
249 <<
", " << scale.y <<
" ).";
253 auto&
transform = found_transform->second;
258void FakeFlatland::SetOrientation(
259 fuchsia::ui::composition::TransformId transform_id,
260 fuchsia::ui::composition::Orientation orientation) {
261 if (transform_id.value == 0) {
264 <<
"FakeFlatland::SetOrientation: TransformId 0 is invalid.";
268 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
271 FML_CHECK(
false) <<
"FakeFlatland::SetOrientation: TransformId "
272 << transform_id.value <<
" does not exist.";
276 auto&
transform = found_transform->second;
281void FakeFlatland::SetOpacity(
282 fuchsia::ui::composition::TransformId transform_id,
284 if (transform_id.value == 0) {
286 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: TransformId 0 is invalid.";
290 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
293 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: TransformId "
294 << transform_id.value <<
" does not exist.";
298 if (value < 0.f || value > 1.f) {
299 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: Invalid opacity value.";
302 auto&
transform = found_transform->second;
307void FakeFlatland::SetClipBoundary(
308 fuchsia::ui::composition::TransformId transform_id,
309 std::unique_ptr<fuchsia::math::Rect> bounds) {
310 if (transform_id.value == 0) {
313 <<
"FakeFlatland::SetClipBoundary: TransformId 0 is invalid.";
317 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
320 FML_CHECK(
false) <<
"FakeFlatland::SetClipBoundary: TransformId "
321 << transform_id.value <<
" does not exist.";
325 auto&
transform = found_transform->second;
327 if (bounds ==
nullptr) {
367void FakeFlatland::AddChild(
368 fuchsia::ui::composition::TransformId parent_transform_id,
369 fuchsia::ui::composition::TransformId child_transform_id) {
370 if (parent_transform_id.value == 0) {
373 <<
"FakeFlatland::AddChild: Parent TransformId 0 is invalid.";
376 if (child_transform_id.value == 0) {
379 <<
"FakeFlatland::AddChild: Child TransformId 0 is invalid.";
384 pending_graph_.
transform_map.find(parent_transform_id.value);
387 FML_CHECK(
false) <<
"FakeFlatland::AddChild: Parent TransformId "
388 << parent_transform_id.value <<
" does not exist.";
395 FML_CHECK(
false) <<
"FakeFlatland::AddChild: Child TransformId "
396 << child_transform_id.value <<
" does not exist.";
399 auto found_child_old_parent = parents_map_.find(child_transform_id.value);
400 if (found_child_old_parent == parents_map_.end()) {
403 <<
"FakeFlatland::AddChild: Internal error - Child TransformId "
404 << child_transform_id.value <<
" is not in parents_map.";
407 if (found_child_old_parent->second.second.expired()) {
410 <<
"FakeFlatland::AddChild: Internal error - Child TransformId "
411 << child_transform_id.value <<
" is expired in parents_map.";
415 auto& child = found_child->second;
416 auto& new_parent = found_parent->second;
417 new_parent->children.push_back(child);
418 if (
auto old_parent = found_child_old_parent->second.first.lock()) {
419 old_parent->children.erase(std::remove_if(
420 old_parent->children.begin(), old_parent->children.end(),
421 [&child](
const auto&
transform) { return transform == child; }));
423 found_child_old_parent->second.first = std::weak_ptr(new_parent);
426void FakeFlatland::RemoveChild(
427 fuchsia::ui::composition::TransformId parent_transform_id,
428 fuchsia::ui::composition::TransformId child_transform_id) {
429 if (parent_transform_id.value == 0) {
432 <<
"FakeFlatland::RemoveChild: Parent TransformId 0 is invalid.";
435 if (child_transform_id.value == 0) {
438 <<
"FakeFlatland::RemoveChild: Child TransformId 0 is invalid.";
446 FML_CHECK(
false) <<
"FakeFlatland::RemoveChild: Child TransformId "
447 << child_transform_id.value <<
" does not exist.";
452 pending_graph_.
transform_map.find(parent_transform_id.value);
455 FML_CHECK(
false) <<
"FakeFlatland::RemoveChild: Parent TransformId "
456 << parent_transform_id.value <<
" does not exist.";
460 auto found_child_parent = parents_map_.find(child_transform_id.value);
461 if (found_child_parent == parents_map_.end()) {
464 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
465 << child_transform_id.value <<
" is not in parents_map.";
468 if (found_child_parent->second.second.expired()) {
471 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
472 << child_transform_id.value <<
" is expired in parents_map.";
475 if (found_child_parent->second.first.lock() != found_parent->second) {
478 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
479 << child_transform_id.value <<
" is not a child of Parent TransformId "
480 << parent_transform_id.value <<
".";
484 found_child_parent->second.first = std::weak_ptr<FakeTransform>();
485 found_parent->second->children.erase(std::remove_if(
486 found_parent->second->children.begin(),
487 found_parent->second->children.end(),
488 [child_to_remove = found_child->second](
const auto& child) {
489 return child == child_to_remove;
493void FakeFlatland::SetContent(
494 fuchsia::ui::composition::TransformId transform_id,
495 fuchsia::ui::composition::ContentId content_id) {
496 if (transform_id.value == 0) {
498 FML_CHECK(
false) <<
"FakeFlatland::SetContent: TransformId 0 is invalid.";
502 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
505 FML_CHECK(
false) <<
"FakeFlatland::SetContent: TransformId "
506 << transform_id.value <<
" does not exist.";
510 auto&
transform = found_transform->second;
512 if (content_id.value == 0) {
517 auto found_content = pending_graph_.
content_map.find(content_id.value);
518 if (found_content == pending_graph_.
content_map.end()) {
520 FML_CHECK(
false) <<
"FakeFlatland::SetContent: ContentId "
521 << content_id.value <<
" does not exist.";
525 auto&
content = found_content->second;
530void FakeFlatland::SetRootTransform(
531 fuchsia::ui::composition::TransformId transform_id) {
532 if (transform_id.value == 0) {
535 <<
"FakeFlatland::SetRootTransform: TransformId 0 is invalid.";
539 auto found_new_root = pending_graph_.
transform_map.find(transform_id.value);
542 FML_CHECK(
false) <<
"FakeFlatland::SetRootTransform: TransformId "
543 << transform_id.value <<
" does not exist.";
550void FakeFlatland::CreateViewport(
551 fuchsia::ui::composition::ContentId viewport_id,
552 fuchsia::ui::views::ViewportCreationToken token,
553 fuchsia::ui::composition::ViewportProperties properties,
554 fidl::InterfaceRequest<fuchsia::ui::composition::ChildViewWatcher>
555 child_view_watcher) {
556 if (viewport_id.value == 0) {
558 FML_CHECK(
false) <<
"FakeFlatland::CreateViewport: ContentId 0 is invalid.";
561 if (pending_graph_.
content_map.count(viewport_id.value) != 0) {
563 FML_CHECK(
false) <<
"FakeFlatland::CreateViewport: ContentId "
564 << viewport_id.value <<
" is already in use.";
568 auto viewport_token_koids =
GetKoids(token.value);
569 auto [emplaced_viewport, emplace_success] =
572 std::make_shared<FakeContent>(FakeViewport{
574 .viewport_properties = std::move(properties),
575 .viewport_token = viewport_token_koids.first,
576 .child_view_watcher = GetKoids(child_view_watcher).first,
580 <<
"FakeFlatland::CreateViewport: Internal error (content_map) adding "
582 << viewport_id.value;
584 auto [_, emplace_binding_success] = graph_bindings_.view_watchers.emplace(
585 viewport_token_koids.first,
586 ChildViewWatcher(std::move(token), std::move(child_view_watcher),
587 flatland_binding_.dispatcher()));
590 <<
"FakeFlatland::CreateViewport: Internal error (view_watcher) adding "
592 << viewport_id.value;
595void FakeFlatland::CreateImage(
596 fuchsia::ui::composition::ContentId image_id,
597 fuchsia::ui::composition::BufferCollectionImportToken import_token,
599 fuchsia::ui::composition::ImageProperties properties) {
600 if (image_id.value == 0) {
602 FML_CHECK(
false) <<
"FakeFlatland::CreateImage: ContentId 0 is invalid.";
605 if (pending_graph_.
content_map.count(image_id.value) != 0) {
607 FML_CHECK(
false) <<
"FakeFlatland::CreateImage: ContentId "
608 << image_id.value <<
" is already in use.";
612 auto import_token_koids =
GetKoids(import_token);
613 auto [emplaced_image, emplace_success] = pending_graph_.
content_map.emplace(
614 image_id.value, std::make_shared<FakeContent>(FakeImage{
616 .image_properties = std::move(properties),
617 .import_token = import_token_koids.first,
618 .vmo_index = vmo_index,
622 <<
"FakeFlatland::CreateImage: Internal error (content_map) adding "
626 auto [_, emplace_binding_success] = graph_bindings_.images.emplace(
627 import_token_koids.first, ImageBinding{
628 .import_token = std::move(import_token),
632 <<
"FakeFlatland::CreateImage: Internal error (images_binding) adding "
637void FakeFlatland::SetImageSampleRegion(
638 fuchsia::ui::composition::ContentId image_id,
639 fuchsia::math::RectF rect) {
640 if (image_id.value == 0) {
643 <<
"FakeFlatland::SetImageSampleRegion: ContentId 0 is invalid.";
647 auto found_content = pending_graph_.
content_map.find(image_id.value);
648 if (found_content == pending_graph_.
content_map.end()) {
650 FML_CHECK(
false) <<
"FakeFlatland::SetImageSampleRegion: ContentId "
651 << image_id.value <<
" does not exist.";
655 auto&
content = found_content->second;
657 FakeImage*
image = std::get_if<FakeImage>(
content.get());
658 if (
image ==
nullptr) {
660 FML_CHECK(
false) <<
"FakeFlatland::SetImageSampleRegion: ContentId "
661 << image_id.value <<
" is not an Image.";
665 image->sample_region = rect;
668void FakeFlatland::SetImageDestinationSize(
669 fuchsia::ui::composition::ContentId image_id,
670 fuchsia::math::SizeU size) {
671 if (image_id.value == 0) {
674 <<
"FakeFlatland::SetImageDestinationSize: ContentId 0 is invalid.";
678 auto found_content = pending_graph_.
content_map.find(image_id.value);
679 if (found_content == pending_graph_.
content_map.end()) {
681 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
682 << image_id.value <<
" does not exist.";
686 auto&
content = found_content->second;
688 FakeImage*
image = std::get_if<FakeImage>(
content.get());
689 if (
image ==
nullptr) {
691 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
692 << image_id.value <<
" is not an Image.";
699void FakeFlatland::SetImageBlendingFunction(
700 fuchsia::ui::composition::ContentId image_id,
701 fuchsia::ui::composition::BlendMode blend_mode) {
702 if (image_id.value == 0) {
705 <<
"FakeFlatland::SetImageDestinationSize: ContentId 0 is invalid.";
709 auto found_content = pending_graph_.
content_map.find(image_id.value);
710 if (found_content == pending_graph_.
content_map.end()) {
712 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
713 << image_id.value <<
" does not exist.";
717 auto&
content = found_content->second;
719 FakeImage*
image = std::get_if<FakeImage>(
content.get());
720 if (
image ==
nullptr) {
722 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
723 << image_id.value <<
" is not an Image.";
727 image->blend_mode = blend_mode;
730void FakeFlatland::SetViewportProperties(
731 fuchsia::ui::composition::ContentId viewport_id,
732 fuchsia::ui::composition::ViewportProperties properties) {
733 if (viewport_id.value == 0) {
736 <<
"FakeFlatland::SetViewportProperties: ContentId 0 is invalid.";
740 auto found_content = pending_graph_.
content_map.find(viewport_id.value);
741 if (found_content == pending_graph_.
content_map.end()) {
743 FML_CHECK(
false) <<
"FakeFlatland::SetViewportProperties: ContentId "
744 << viewport_id.value <<
" does not exist.";
748 auto&
content = found_content->second;
750 FakeViewport* viewport = std::get_if<FakeViewport>(
content.get());
751 if (viewport ==
nullptr) {
753 FML_CHECK(
false) <<
"FakeFlatland::SetViewportProperties: ContentId "
754 << viewport_id.value <<
" is not a Viewport.";
758 viewport->viewport_properties = std::move(properties);
761void FakeFlatland::ReleaseTransform(
762 fuchsia::ui::composition::TransformId transform_id) {
763 if (transform_id.value == 0) {
766 <<
"FakeFlatland::ReleaseTransform: TransformId 0 is invalid.";
770 size_t erased = pending_graph_.
transform_map.erase(transform_id.value);
773 FML_CHECK(
false) <<
"FakeFlatland::ReleaseTransform: TransformId "
774 << transform_id.value <<
" does not exist.";
777 size_t parents_erased = parents_map_.erase(transform_id.value);
778 if (parents_erased == 0) {
780 FML_CHECK(
false) <<
"FakeFlatland::ReleaseTransform: TransformId "
781 << transform_id.value <<
" does not exist in parents_map.";
785void FakeFlatland::ReleaseViewport(
786 fuchsia::ui::composition::ContentId viewport_id,
788 if (viewport_id.value == 0) {
791 <<
"FakeFlatland::ReleaseViewport: ContentId 0 is invalid.";
795 auto found_content = pending_graph_.
content_map.find(viewport_id.value);
796 if (found_content == pending_graph_.
content_map.end()) {
798 FML_CHECK(
false) <<
"FakeFlatland::ReleaseViewport: ContentId "
799 << viewport_id.value <<
" does not exist.";
803 auto&
content = found_content->second;
805 FakeViewport* viewport = std::get_if<FakeViewport>(
content.get());
806 if (viewport ==
nullptr) {
808 FML_CHECK(
false) <<
"FakeFlatland::ReleaseViewport: ContentId "
809 << viewport_id.value <<
" is not a Viewport.";
816void FakeFlatland::ReleaseImage(fuchsia::ui::composition::ContentId image_id) {
817 if (image_id.value == 0) {
819 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId 0 is invalid.";
823 auto found_content = pending_graph_.
content_map.find(image_id.value);
824 if (found_content == pending_graph_.
content_map.end()) {
826 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId "
827 << image_id.value <<
" does not exist.";
831 auto&
content = found_content->second;
833 FakeImage*
image = std::get_if<FakeImage>(
content.get());
834 if (
image ==
nullptr) {
836 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId "
837 << image_id.value <<
" is not a Viewport.";
844void FakeFlatland::SetHitRegions(
845 fuchsia::ui::composition::TransformId transform_id,
846 std::vector<fuchsia::ui::composition::HitRegion> regions) {
847 if (transform_id.value == 0) {
850 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
854 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
857 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
858 << transform_id.value <<
" does not exist.";
862 auto&
transform = found_transform->second;
864 transform->hit_regions = std::move(regions);
867void FakeFlatland::SetInfiniteHitRegion(
868 fuchsia::ui::composition::TransformId transform_id,
869 fuchsia::ui::composition::HitTestInteraction hit_test) {
870 if (transform_id.value == 0) {
873 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
877 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
880 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
881 << transform_id.value <<
" does not exist.";
885 auto&
transform = found_transform->second;
890void FakeFlatland::Clear() {
891 parents_map_.clear();
892 pending_graph_.
Clear();
895void FakeFlatland::SetDebugName(std::string
debug_name) {
899FakeFlatland::ParentViewportWatcher::ParentViewportWatcher(
900 fuchsia::ui::views::ViewCreationToken view_token,
901 fuchsia::ui::views::ViewIdentityOnCreation view_identity,
902 fuchsia::ui::composition::ViewBoundProtocols view_protocols,
903 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
904 parent_viewport_watcher,
905 async_dispatcher_t* dispatcher)
906 : view_token(
std::move(view_token)),
907 view_identity(
std::move(view_identity)),
908 view_protocols(
std::move(view_protocols)),
909 parent_viewport_watcher(this,
910 std::move(parent_viewport_watcher),
913FakeFlatland::ParentViewportWatcher::ParentViewportWatcher(
914 ParentViewportWatcher&& other)
915 : view_token(
std::move(other.view_token)),
916 view_identity(
std::move(other.view_identity)),
917 view_protocols(
std::move(other.view_protocols)),
918 parent_viewport_watcher(this,
919 other.parent_viewport_watcher.Unbind(),
920 other.parent_viewport_watcher.dispatcher()) {}
922FakeFlatland::ParentViewportWatcher::~ParentViewportWatcher() =
default;
924void FakeFlatland::ParentViewportWatcher::NotImplemented_(
925 const std::string&
name) {
926 FML_LOG(FATAL) <<
"FakeFlatland::ParentViewportWatcher does not implement "
930void FakeFlatland::ParentViewportWatcher::GetLayout(
932 NotImplemented_(
"GetLayout");
935void FakeFlatland::ParentViewportWatcher::GetStatus(
937 NotImplemented_(
"GetStatus");
940FakeFlatland::ChildViewWatcher::ChildViewWatcher(
941 fuchsia::ui::views::ViewportCreationToken viewport_token,
942 fidl::InterfaceRequest<fuchsia::ui::composition::ChildViewWatcher>
944 async_dispatcher_t* dispatcher)
945 : viewport_token(
std::move(viewport_token)),
946 child_view_watcher(this,
std::move(child_view_watcher), dispatcher) {}
948FakeFlatland::ChildViewWatcher::ChildViewWatcher(ChildViewWatcher&& other)
949 : viewport_token(
std::move(other.viewport_token)),
950 child_view_watcher(this,
951 other.child_view_watcher.Unbind(),
952 other.child_view_watcher.dispatcher()) {}
954FakeFlatland::ChildViewWatcher::~ChildViewWatcher() =
default;
956void FakeFlatland::ChildViewWatcher::NotImplemented_(
const std::string&
name) {
957 FML_LOG(FATAL) <<
"FakeFlatland::ChildViewWatcher does not implement "
961void FakeFlatland::ChildViewWatcher::GetStatus(GetStatusCallback
callback) {
962 NotImplemented_(
"GetStatus");
fuchsia::ui::composition::FlatlandHandle ConnectFlatland(async_dispatcher_t *dispatcher=nullptr)
fuchsia::ui::composition::AllocatorHandle ConnectAllocator(async_dispatcher_t *dispatcher=nullptr)
std::function< void(fuchsia::ui::composition::PresentArgs)> PresentHandler
void SetPresentHandler(PresentHandler present_handler)
void FireOnFramePresentedEvent(fuchsia::scenic::scheduling::FramePresentedInfo frame_presented_info)
const std::string & debug_name() const
void FireOnNextFrameBeginEvent(fuchsia::ui::composition::OnNextFrameBeginValues on_next_frame_begin_values)
void Disconnect(fuchsia::ui::composition::FlatlandError error)
FlutterVulkanImage * image
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
const uint8_t uint32_t uint32_t GError ** error
FlutterDesktopBinaryReply callback
#define FML_LOG(severity)
#define FML_CHECK(condition)
union flutter::testing::@2824::KeyboardChange::@78 content
std::pair< zx_koid_t, zx_koid_t > GetKoids(const ZX &kobj)
static constexpr fuchsia::ui::composition::HitRegion kInfiniteHitRegion
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
std::optional< FakeView > view
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