7#include <zircon/types.h>
12#include "flutter/fml/logging.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) {
72void FakeFlatland::RegisterBufferCollection(
73 fuchsia::ui::composition::RegisterBufferCollectionArgs
args,
74 RegisterBufferCollectionCallback
callback) {
75 auto [export_token_koid, _] =
GetKoids(
args.export_token());
76 auto [
__, emplace_binding_success] =
77 graph_bindings_.buffer_collections.emplace(
79 BufferCollectionBinding{
80 .export_token = std::move(*
args.mutable_export_token()),
82 std::move(*
args.mutable_buffer_collection_token()),
83 .usage =
args.usage(),
87 <<
"FakeFlatland::RegisterBufferCollection: BufferCollection already "
92void FakeFlatland::Present(fuchsia::ui::composition::PresentArgs
args) {
98 current_graph_ = pending_graph_.
Clone();
100 present_handler_(std::move(
args));
103void FakeFlatland::CreateView(
104 fuchsia::ui::views::ViewCreationToken token,
105 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
106 parent_viewport_watcher) {
107 CreateView2(std::move(token), fuchsia::ui::views::ViewIdentityOnCreation{},
108 fuchsia::ui::composition::ViewBoundProtocols{},
109 std::move(parent_viewport_watcher));
112void FakeFlatland::CreateView2(
113 fuchsia::ui::views::ViewCreationToken token,
114 fuchsia::ui::views::ViewIdentityOnCreation view_identity,
115 fuchsia::ui::composition::ViewBoundProtocols view_protocols,
116 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
117 parent_viewport_watcher) {
120 FML_CHECK(!graph_bindings_.viewport_watcher.has_value());
122 auto view_token_koids =
GetKoids(token);
123 auto view_ref_koids =
GetKoids(view_identity.view_ref);
124 auto view_ref_control_koids =
GetKoids(view_identity.view_ref_control);
125 FML_CHECK(view_ref_koids.first == view_ref_control_koids.second);
126 FML_CHECK(view_ref_koids.second == view_ref_control_koids.first);
128 pending_graph_.
view.emplace(FakeView{
129 .view_token = view_token_koids.first,
130 .view_ref = view_ref_koids.first,
131 .view_ref_control = view_ref_control_koids.first,
133 view_protocols.has_view_ref_focused()
134 ?
GetKoids(view_protocols.view_ref_focused()).first
136 .focuser = view_protocols.has_view_focuser()
137 ?
GetKoids(view_protocols.view_focuser()).first
139 .touch_source = view_protocols.has_touch_source()
140 ?
GetKoids(view_protocols.touch_source()).first
142 .mouse_source = view_protocols.has_mouse_source()
143 ?
GetKoids(view_protocols.mouse_source()).first
145 .parent_viewport_watcher =
GetKoids(parent_viewport_watcher).first,
147 graph_bindings_.viewport_watcher.emplace(
148 view_token_koids.first,
149 ParentViewportWatcher(
150 std::move(token), std::move(view_identity), std::move(view_protocols),
151 std::move(parent_viewport_watcher), flatland_binding_.dispatcher()));
154void FakeFlatland::CreateTransform(
155 fuchsia::ui::composition::TransformId transform_id) {
156 if (transform_id.value == 0) {
159 <<
"FakeFlatland::CreateTransform: TransformId 0 is invalid.";
162 if (pending_graph_.
transform_map.count(transform_id.value) != 0) {
164 FML_CHECK(
false) <<
"FakeFlatland::CreateTransform: TransformId "
165 << transform_id.value <<
" is already in use.";
169 auto [emplaced_transform, emplace_success] =
171 transform_id.value, std::make_shared<FakeTransform>(FakeTransform{
176 <<
"FakeFlatland::CreateTransform: Internal error (transform_map) adding "
177 "transform with id: "
178 << transform_id.value;
180 auto [_, emplace_parent_success] = parents_map_.emplace(
182 std::make_pair(std::weak_ptr<FakeTransform>(),
183 std::weak_ptr(emplaced_transform->second)));
186 <<
"FakeFlatland::CreateTransform: Internal error (parent_map) adding "
187 "transform with id: "
188 << transform_id.value;
191void FakeFlatland::SetTranslation(
192 fuchsia::ui::composition::TransformId transform_id,
193 fuchsia::math::Vec translation) {
194 if (transform_id.value == 0) {
197 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
201 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
204 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
205 << transform_id.value <<
" does not exist.";
209 auto&
transform = found_transform->second;
214void FakeFlatland::SetScale(fuchsia::ui::composition::TransformId transform_id,
215 fuchsia::math::VecF
scale) {
216 if (transform_id.value == 0) {
218 FML_CHECK(
false) <<
"FakeFlatland::SetScale: TransformId 0 is invalid.";
222 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
225 FML_CHECK(
false) <<
"FakeFlatland::SetScale: TransformId "
226 << transform_id.value <<
" does not exist.";
231 FML_CHECK(
false) <<
"SetScale failed, zero values not allowed (" <<
scale.x
232 <<
", " <<
scale.y <<
" ).";
237 FML_CHECK(
false) <<
"SetScale failed, invalid scale values (" <<
scale.x
238 <<
", " <<
scale.y <<
" ).";
242 auto&
transform = found_transform->second;
247void FakeFlatland::SetOrientation(
248 fuchsia::ui::composition::TransformId transform_id,
249 fuchsia::ui::composition::Orientation orientation) {
250 if (transform_id.value == 0) {
253 <<
"FakeFlatland::SetOrientation: TransformId 0 is invalid.";
257 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
260 FML_CHECK(
false) <<
"FakeFlatland::SetOrientation: TransformId "
261 << transform_id.value <<
" does not exist.";
265 auto&
transform = found_transform->second;
270void FakeFlatland::SetOpacity(
271 fuchsia::ui::composition::TransformId transform_id,
273 if (transform_id.value == 0) {
275 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: TransformId 0 is invalid.";
279 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
282 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: TransformId "
283 << transform_id.value <<
" does not exist.";
287 if (value < 0.f || value > 1.f) {
288 FML_CHECK(
false) <<
"FakeFlatland::SetOpacity: Invalid opacity value.";
291 auto&
transform = found_transform->second;
296void FakeFlatland::SetClipBoundary(
297 fuchsia::ui::composition::TransformId transform_id,
298 std::unique_ptr<fuchsia::math::Rect>
bounds) {
299 if (transform_id.value == 0) {
302 <<
"FakeFlatland::SetClipBoundary: TransformId 0 is invalid.";
306 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
309 FML_CHECK(
false) <<
"FakeFlatland::SetClipBoundary: TransformId "
310 << transform_id.value <<
" does not exist.";
314 auto&
transform = found_transform->second;
356void FakeFlatland::AddChild(
357 fuchsia::ui::composition::TransformId parent_transform_id,
358 fuchsia::ui::composition::TransformId child_transform_id) {
359 if (parent_transform_id.value == 0) {
362 <<
"FakeFlatland::AddChild: Parent TransformId 0 is invalid.";
365 if (child_transform_id.value == 0) {
368 <<
"FakeFlatland::AddChild: Child TransformId 0 is invalid.";
373 pending_graph_.
transform_map.find(parent_transform_id.value);
376 FML_CHECK(
false) <<
"FakeFlatland::AddChild: Parent TransformId "
377 << parent_transform_id.value <<
" does not exist.";
384 FML_CHECK(
false) <<
"FakeFlatland::AddChild: Child TransformId "
385 << child_transform_id.value <<
" does not exist.";
388 auto found_child_old_parent = parents_map_.find(child_transform_id.value);
389 if (found_child_old_parent == parents_map_.end()) {
392 <<
"FakeFlatland::AddChild: Internal error - Child TransformId "
393 << child_transform_id.value <<
" is not in parents_map.";
396 if (found_child_old_parent->second.second.expired()) {
399 <<
"FakeFlatland::AddChild: Internal error - Child TransformId "
400 << child_transform_id.value <<
" is expired in parents_map.";
404 auto& child = found_child->second;
405 auto& new_parent = found_parent->second;
406 new_parent->children.push_back(child);
407 if (
auto old_parent = found_child_old_parent->second.first.lock()) {
408 old_parent->children.erase(std::remove_if(
409 old_parent->children.begin(), old_parent->children.end(),
410 [&child](
const auto&
transform) { return transform == child; }));
412 found_child_old_parent->second.first = std::weak_ptr(new_parent);
415void FakeFlatland::RemoveChild(
416 fuchsia::ui::composition::TransformId parent_transform_id,
417 fuchsia::ui::composition::TransformId child_transform_id) {
418 if (parent_transform_id.value == 0) {
421 <<
"FakeFlatland::RemoveChild: Parent TransformId 0 is invalid.";
424 if (child_transform_id.value == 0) {
427 <<
"FakeFlatland::RemoveChild: Child TransformId 0 is invalid.";
435 FML_CHECK(
false) <<
"FakeFlatland::RemoveChild: Child TransformId "
436 << child_transform_id.value <<
" does not exist.";
441 pending_graph_.
transform_map.find(parent_transform_id.value);
444 FML_CHECK(
false) <<
"FakeFlatland::RemoveChild: Parent TransformId "
445 << parent_transform_id.value <<
" does not exist.";
449 auto found_child_parent = parents_map_.find(child_transform_id.value);
450 if (found_child_parent == parents_map_.end()) {
453 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
454 << child_transform_id.value <<
" is not in parents_map.";
457 if (found_child_parent->second.second.expired()) {
460 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
461 << child_transform_id.value <<
" is expired in parents_map.";
464 if (found_child_parent->second.first.lock() != found_parent->second) {
467 <<
"FakeFlatland::RemoveChild: Internal error - Child TransformId "
468 << child_transform_id.value <<
" is not a child of Parent TransformId "
469 << parent_transform_id.value <<
".";
473 found_child_parent->second.first = std::weak_ptr<FakeTransform>();
474 found_parent->second->children.erase(std::remove_if(
475 found_parent->second->children.begin(),
476 found_parent->second->children.end(),
477 [child_to_remove = found_child->second](
const auto& child) {
478 return child == child_to_remove;
482void FakeFlatland::SetContent(
483 fuchsia::ui::composition::TransformId transform_id,
484 fuchsia::ui::composition::ContentId content_id) {
485 if (transform_id.value == 0) {
487 FML_CHECK(
false) <<
"FakeFlatland::SetContent: TransformId 0 is invalid.";
491 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
494 FML_CHECK(
false) <<
"FakeFlatland::SetContent: TransformId "
495 << transform_id.value <<
" does not exist.";
499 auto&
transform = found_transform->second;
501 if (content_id.value == 0) {
506 auto found_content = pending_graph_.
content_map.find(content_id.value);
507 if (found_content == pending_graph_.
content_map.end()) {
509 FML_CHECK(
false) <<
"FakeFlatland::SetContent: ContentId "
510 << content_id.value <<
" does not exist.";
514 auto&
content = found_content->second;
519void FakeFlatland::SetRootTransform(
520 fuchsia::ui::composition::TransformId transform_id) {
521 if (transform_id.value == 0) {
524 <<
"FakeFlatland::SetRootTransform: TransformId 0 is invalid.";
528 auto found_new_root = pending_graph_.
transform_map.find(transform_id.value);
531 FML_CHECK(
false) <<
"FakeFlatland::SetRootTransform: TransformId "
532 << transform_id.value <<
" does not exist.";
539void FakeFlatland::CreateViewport(
540 fuchsia::ui::composition::ContentId viewport_id,
541 fuchsia::ui::views::ViewportCreationToken token,
542 fuchsia::ui::composition::ViewportProperties properties,
543 fidl::InterfaceRequest<fuchsia::ui::composition::ChildViewWatcher>
544 child_view_watcher) {
545 if (viewport_id.value == 0) {
547 FML_CHECK(
false) <<
"FakeFlatland::CreateViewport: ContentId 0 is invalid.";
550 if (pending_graph_.
content_map.count(viewport_id.value) != 0) {
552 FML_CHECK(
false) <<
"FakeFlatland::CreateViewport: ContentId "
553 << viewport_id.value <<
" is already in use.";
557 auto viewport_token_koids =
GetKoids(token.value);
558 auto [emplaced_viewport, emplace_success] =
561 std::make_shared<FakeContent>(FakeViewport{
563 .viewport_properties = std::move(properties),
564 .viewport_token = viewport_token_koids.first,
565 .child_view_watcher = GetKoids(child_view_watcher).first,
569 <<
"FakeFlatland::CreateViewport: Internal error (content_map) adding "
571 << viewport_id.value;
573 auto [_, emplace_binding_success] = graph_bindings_.view_watchers.emplace(
574 viewport_token_koids.first,
575 ChildViewWatcher(std::move(token), std::move(child_view_watcher),
576 flatland_binding_.dispatcher()));
579 <<
"FakeFlatland::CreateViewport: Internal error (view_watcher) adding "
581 << viewport_id.value;
584void FakeFlatland::CreateImage(
585 fuchsia::ui::composition::ContentId image_id,
586 fuchsia::ui::composition::BufferCollectionImportToken import_token,
588 fuchsia::ui::composition::ImageProperties properties) {
589 if (image_id.value == 0) {
591 FML_CHECK(
false) <<
"FakeFlatland::CreateImage: ContentId 0 is invalid.";
594 if (pending_graph_.
content_map.count(image_id.value) != 0) {
596 FML_CHECK(
false) <<
"FakeFlatland::CreateImage: ContentId "
597 << image_id.value <<
" is already in use.";
601 auto import_token_koids =
GetKoids(import_token);
602 auto [emplaced_image, emplace_success] = pending_graph_.
content_map.emplace(
603 image_id.value, std::make_shared<FakeContent>(FakeImage{
605 .image_properties = std::move(properties),
606 .import_token = import_token_koids.first,
607 .vmo_index = vmo_index,
611 <<
"FakeFlatland::CreateImage: Internal error (content_map) adding "
615 auto [_, emplace_binding_success] = graph_bindings_.images.emplace(
616 import_token_koids.first, ImageBinding{
617 .import_token = std::move(import_token),
621 <<
"FakeFlatland::CreateImage: Internal error (images_binding) adding "
626void FakeFlatland::SetImageSampleRegion(
627 fuchsia::ui::composition::ContentId image_id,
628 fuchsia::math::RectF
rect) {
629 if (image_id.value == 0) {
632 <<
"FakeFlatland::SetImageSampleRegion: ContentId 0 is invalid.";
636 auto found_content = pending_graph_.
content_map.find(image_id.value);
637 if (found_content == pending_graph_.
content_map.end()) {
639 FML_CHECK(
false) <<
"FakeFlatland::SetImageSampleRegion: ContentId "
640 << image_id.value <<
" does not exist.";
644 auto&
content = found_content->second;
646 FakeImage*
image = std::get_if<FakeImage>(
content.get());
647 if (
image ==
nullptr) {
649 FML_CHECK(
false) <<
"FakeFlatland::SetImageSampleRegion: ContentId "
650 << image_id.value <<
" is not an Image.";
657void FakeFlatland::SetImageDestinationSize(
658 fuchsia::ui::composition::ContentId image_id,
659 fuchsia::math::SizeU
size) {
660 if (image_id.value == 0) {
663 <<
"FakeFlatland::SetImageDestinationSize: ContentId 0 is invalid.";
667 auto found_content = pending_graph_.
content_map.find(image_id.value);
668 if (found_content == pending_graph_.
content_map.end()) {
670 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
671 << image_id.value <<
" does not exist.";
675 auto&
content = found_content->second;
677 FakeImage*
image = std::get_if<FakeImage>(
content.get());
678 if (
image ==
nullptr) {
680 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
681 << image_id.value <<
" is not an Image.";
688void FakeFlatland::SetImageBlendingFunction(
689 fuchsia::ui::composition::ContentId image_id,
691 if (image_id.value == 0) {
694 <<
"FakeFlatland::SetImageDestinationSize: ContentId 0 is invalid.";
698 auto found_content = pending_graph_.
content_map.find(image_id.value);
699 if (found_content == pending_graph_.
content_map.end()) {
701 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
702 << image_id.value <<
" does not exist.";
706 auto&
content = found_content->second;
708 FakeImage*
image = std::get_if<FakeImage>(
content.get());
709 if (
image ==
nullptr) {
711 FML_CHECK(
false) <<
"FakeFlatland::SetImageDestinationSize: ContentId "
712 << image_id.value <<
" is not an Image.";
716 image->blend_mode = blend_mode;
719void FakeFlatland::SetViewportProperties(
720 fuchsia::ui::composition::ContentId viewport_id,
721 fuchsia::ui::composition::ViewportProperties properties) {
722 if (viewport_id.value == 0) {
725 <<
"FakeFlatland::SetViewportProperties: ContentId 0 is invalid.";
729 auto found_content = pending_graph_.
content_map.find(viewport_id.value);
730 if (found_content == pending_graph_.
content_map.end()) {
732 FML_CHECK(
false) <<
"FakeFlatland::SetViewportProperties: ContentId "
733 << viewport_id.value <<
" does not exist.";
737 auto&
content = found_content->second;
739 FakeViewport* viewport = std::get_if<FakeViewport>(
content.get());
740 if (viewport ==
nullptr) {
742 FML_CHECK(
false) <<
"FakeFlatland::SetViewportProperties: ContentId "
743 << viewport_id.value <<
" is not a Viewport.";
747 viewport->viewport_properties = std::move(properties);
750void FakeFlatland::ReleaseTransform(
751 fuchsia::ui::composition::TransformId transform_id) {
752 if (transform_id.value == 0) {
755 <<
"FakeFlatland::ReleaseTransform: TransformId 0 is invalid.";
759 size_t erased = pending_graph_.
transform_map.erase(transform_id.value);
762 FML_CHECK(
false) <<
"FakeFlatland::ReleaseTransform: TransformId "
763 << transform_id.value <<
" does not exist.";
766 size_t parents_erased = parents_map_.erase(transform_id.value);
767 if (parents_erased == 0) {
769 FML_CHECK(
false) <<
"FakeFlatland::ReleaseTransform: TransformId "
770 << transform_id.value <<
" does not exist in parents_map.";
774void FakeFlatland::ReleaseViewport(
775 fuchsia::ui::composition::ContentId viewport_id,
777 if (viewport_id.value == 0) {
780 <<
"FakeFlatland::ReleaseViewport: ContentId 0 is invalid.";
784 auto found_content = pending_graph_.
content_map.find(viewport_id.value);
785 if (found_content == pending_graph_.
content_map.end()) {
787 FML_CHECK(
false) <<
"FakeFlatland::ReleaseViewport: ContentId "
788 << viewport_id.value <<
" does not exist.";
792 auto&
content = found_content->second;
794 FakeViewport* viewport = std::get_if<FakeViewport>(
content.get());
795 if (viewport ==
nullptr) {
797 FML_CHECK(
false) <<
"FakeFlatland::ReleaseViewport: ContentId "
798 << viewport_id.value <<
" is not a Viewport.";
805void FakeFlatland::ReleaseImage(fuchsia::ui::composition::ContentId image_id) {
806 if (image_id.value == 0) {
808 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId 0 is invalid.";
812 auto found_content = pending_graph_.
content_map.find(image_id.value);
813 if (found_content == pending_graph_.
content_map.end()) {
815 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId "
816 << image_id.value <<
" does not exist.";
820 auto&
content = found_content->second;
822 FakeImage*
image = std::get_if<FakeImage>(
content.get());
823 if (
image ==
nullptr) {
825 FML_CHECK(
false) <<
"FakeFlatland::ReleaseImage: ContentId "
826 << image_id.value <<
" is not a Viewport.";
833void FakeFlatland::SetHitRegions(
834 fuchsia::ui::composition::TransformId transform_id,
835 std::vector<fuchsia::ui::composition::HitRegion> regions) {
836 if (transform_id.value == 0) {
839 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
843 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
846 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
847 << transform_id.value <<
" does not exist.";
851 auto&
transform = found_transform->second;
853 transform->hit_regions = std::move(regions);
856void FakeFlatland::SetInfiniteHitRegion(
857 fuchsia::ui::composition::TransformId transform_id,
858 fuchsia::ui::composition::HitTestInteraction hit_test) {
859 if (transform_id.value == 0) {
862 <<
"FakeFlatland::SetTranslation: TransformId 0 is invalid.";
866 auto found_transform = pending_graph_.
transform_map.find(transform_id.value);
869 FML_CHECK(
false) <<
"FakeFlatland::SetTranslation: TransformId "
870 << transform_id.value <<
" does not exist.";
874 auto&
transform = found_transform->second;
879void FakeFlatland::Clear() {
880 parents_map_.clear();
881 pending_graph_.
Clear();
884void FakeFlatland::SetDebugName(std::string debug_name) {
888FakeFlatland::ParentViewportWatcher::ParentViewportWatcher(
889 fuchsia::ui::views::ViewCreationToken view_token,
890 fuchsia::ui::views::ViewIdentityOnCreation view_identity,
891 fuchsia::ui::composition::ViewBoundProtocols view_protocols,
892 fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher>
893 parent_viewport_watcher,
894 async_dispatcher_t* dispatcher)
895 : view_token(
std::move(view_token)),
896 view_identity(
std::move(view_identity)),
897 view_protocols(
std::move(view_protocols)),
898 parent_viewport_watcher(this,
899 std::move(parent_viewport_watcher),
902FakeFlatland::ParentViewportWatcher::ParentViewportWatcher(
903 ParentViewportWatcher&& other)
904 : view_token(
std::move(other.view_token)),
905 view_identity(
std::move(other.view_identity)),
906 view_protocols(
std::move(other.view_protocols)),
907 parent_viewport_watcher(this,
908 other.parent_viewport_watcher.Unbind(),
909 other.parent_viewport_watcher.dispatcher()) {}
911FakeFlatland::ParentViewportWatcher::~ParentViewportWatcher() =
default;
913void FakeFlatland::ParentViewportWatcher::NotImplemented_(
914 const std::string&
name) {
915 FML_LOG(
FATAL) <<
"FakeFlatland::ParentViewportWatcher does not implement "
919void FakeFlatland::ParentViewportWatcher::GetLayout(
921 NotImplemented_(
"GetLayout");
924void FakeFlatland::ParentViewportWatcher::GetStatus(
926 NotImplemented_(
"GetStatus");
929FakeFlatland::ChildViewWatcher::ChildViewWatcher(
930 fuchsia::ui::views::ViewportCreationToken viewport_token,
931 fidl::InterfaceRequest<fuchsia::ui::composition::ChildViewWatcher>
933 async_dispatcher_t* dispatcher)
934 : viewport_token(
std::move(viewport_token)),
935 child_view_watcher(this,
std::move(child_view_watcher), dispatcher) {}
937FakeFlatland::ChildViewWatcher::ChildViewWatcher(ChildViewWatcher&& other)
938 : viewport_token(
std::move(other.viewport_token)),
939 child_view_watcher(this,
940 other.child_view_watcher.Unbind(),
941 other.child_view_watcher.dispatcher()) {}
943FakeFlatland::ChildViewWatcher::~ChildViewWatcher() =
default;
945void FakeFlatland::ChildViewWatcher::NotImplemented_(
const std::string&
name) {
946 FML_LOG(
FATAL) <<
"FakeFlatland::ChildViewWatcher does not implement "
950void FakeFlatland::ChildViewWatcher::GetStatus(GetStatusCallback
callback) {
951 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)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
#define FML_LOG(severity)
#define FML_CHECK(condition)
union flutter::testing::@2836::KeyboardChange::@76 content
Optional< SkRect > bounds
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
std::pair< zx_koid_t, zx_koid_t > GetKoids(const ZX &kobj)
static constexpr fuchsia::ui::composition::HitRegion kInfiniteHitRegion
DEF_SWITCHES_START aot vmservice shared library name
it will be possible to load the file into Perfetto s trace viewer 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
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
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