5#include "flutter/shell/platform/fuchsia/flutter/external_view_embedder.h"
7#include <fuchsia/math/cpp/fidl.h>
8#include <fuchsia/sysmem/cpp/fidl.h>
9#include <fuchsia/ui/composition/cpp/fidl.h>
10#include <fuchsia/ui/views/cpp/fidl.h>
11#include <lib/async-testing/test_loop.h>
12#include <lib/zx/event.h>
13#include <lib/zx/eventpair.h>
22#include "flutter/flow/embedded_views.h"
23#include "flutter/fml/logging.h"
24#include "flutter/fml/time/time_delta.h"
25#include "flutter/fml/time/time_point.h"
32#include "flutter/shell/platform/fuchsia/flutter/surface_producer.h"
34#include "gmock/gmock.h"
35#include "gtest/gtest.h"
37using fuchsia::scenic::scheduling::FramePresentedInfo;
38using fuchsia::scenic::scheduling::FuturePresentationTimes;
39using fuchsia::scenic::scheduling::PresentReceivedInfo;
41using ::testing::AllOf;
43using ::testing::ElementsAre;
45using ::testing::Field;
46using ::testing::FieldsAre;
48using ::testing::Matcher;
49using ::testing::Pointee;
50using ::testing::Property;
51using ::testing::SizeIs;
52using ::testing::VariantWith;
60 fuchsia::ui::composition::BlendMode::SRC_OVER};
63class FakeSurfaceProducerSurface :
public SurfaceProducerSurface {
65 explicit FakeSurfaceProducerSurface(
66 fidl::InterfaceRequest<fuchsia::sysmem::BufferCollectionToken>
68 fuchsia::ui::composition::BufferCollectionImportToken buffer_import_token,
70 : sysmem_token_request_(
std::move(sysmem_token_request)),
71 buffer_import_token_(
std::move(buffer_import_token)),
74 if (acquire_status != ZX_OK) {
76 <<
"FakeSurfaceProducerSurface: Failed to create acquire event";
79 if (release_status != ZX_OK) {
81 <<
"FakeSurfaceProducerSurface: Failed to create release event";
84 ~FakeSurfaceProducerSurface()
override {}
86 bool IsValid()
const override {
return true; }
88 SkISize GetSize()
const override {
92 void SetImageId(uint32_t image_id)
override { image_id_ = image_id; }
93 uint32_t GetImageId()
override {
return image_id_; }
97 fuchsia::ui::composition::BufferCollectionImportToken
98 GetBufferCollectionImportToken()
override {
99 return std::move(buffer_import_token_);
104 acquire_fence_.duplicate(ZX_RIGHT_SAME_RIGHTS, &fence);
110 release_fence_.duplicate(ZX_RIGHT_SAME_RIGHTS, &fence);
114 void SetReleaseImageCallback(
117 size_t AdvanceAndGetAge()
override {
return 0; }
118 bool FlushSessionAcquireAndReleaseEvents()
override {
return true; }
119 void SignalWritesFinished(
120 const std::function<
void(
void)>& on_writes_committed)
override {}
123 fidl::InterfaceRequest<fuchsia::sysmem::BufferCollectionToken>
124 sysmem_token_request_;
125 fuchsia::ui::composition::BufferCollectionImportToken buffer_import_token_;
130 uint32_t image_id_{0};
133class FakeSurfaceProducer :
public SurfaceProducer {
135 explicit FakeSurfaceProducer(
136 fuchsia::ui::composition::AllocatorHandle flatland_allocator)
138 ~FakeSurfaceProducer()
override =
default;
144 std::unique_ptr<SurfaceProducerSurface> ProduceOffscreenSurface(
150 std::unique_ptr<SurfaceProducerSurface> ProduceSurface(
152 auto [buffer_export_token, buffer_import_token] =
154 fuchsia::sysmem::BufferCollectionTokenHandle sysmem_token;
155 auto sysmem_token_request = sysmem_token.NewRequest();
157 fuchsia::ui::composition::RegisterBufferCollectionArgs
158 buffer_collection_args;
159 buffer_collection_args.set_export_token(std::move(buffer_export_token));
160 buffer_collection_args.set_buffer_collection_token(std::move(sysmem_token));
161 buffer_collection_args.set_usage(
162 fuchsia::ui::composition::RegisterBufferCollectionUsage::DEFAULT);
164 std::move(buffer_collection_args),
165 [](fuchsia::ui::composition::Allocator_RegisterBufferCollection_Result
169 <<
"fuhsia::ui::composition::RegisterBufferCollection error: "
170 << static_cast<uint32_t>(result.err());
174 return std::make_unique<FakeSurfaceProducerSurface>(
175 std::move(sysmem_token_request), std::move(buffer_import_token),
size);
180 std::vector<std::unique_ptr<SurfaceProducerSurface>> surfaces)
override {}
185Matcher<fuchsia::ui::composition::ImageProperties> IsImageProperties(
186 const fuchsia::math::SizeU&
size) {
188 Property(
"has_size", &fuchsia::ui::composition::ImageProperties::has_size,
193Matcher<fuchsia::ui::composition::ViewportProperties> IsViewportProperties(
194 const fuchsia::math::SizeU& logical_size,
195 const fuchsia::math::Inset&
inset) {
197 Property(
"has_logical_size",
198 &fuchsia::ui::composition::ViewportProperties::has_logical_size,
200 Property(
"logical_size",
201 &fuchsia::ui::composition::ViewportProperties::logical_size,
203 Property(
"has_inset",
204 &fuchsia::ui::composition::ViewportProperties::has_inset,
true),
209Matcher<fuchsia::ui::composition::HitRegion> IsHitRegion(
214 const fuchsia::ui::composition::HitTestInteraction hit_test) {
218Matcher<FakeGraph> IsEmptyGraph() {
219 return FieldsAre(
IsEmpty(),
IsEmpty(), Eq(
nullptr), Eq(std::nullopt));
222Matcher<FakeGraph> IsFlutterGraph(
223 const fuchsia::ui::composition::ParentViewportWatcherPtr&
224 parent_viewport_watcher,
225 const fuchsia::ui::views::ViewportCreationToken& viewport_creation_token,
226 const fuchsia::ui::views::ViewRef& view_ref,
227 std::vector<Matcher<std::shared_ptr<FakeTransform>>> layer_matchers = {},
229 auto viewport_token_koids =
GetKoids(viewport_creation_token);
230 auto view_ref_koids =
GetKoids(view_ref);
231 auto watcher_koids =
GetKoids(parent_viewport_watcher);
239 ElementsAreArray(layer_matchers),
242 .view_token = viewport_token_koids.second,
243 .view_ref = view_ref_koids.first,
244 .view_ref_control = view_ref_koids.second,
245 .view_ref_focused = ZX_KOID_INVALID,
246 .focuser = ZX_KOID_INVALID,
247 .touch_source = ZX_KOID_INVALID,
248 .mouse_source = ZX_KOID_INVALID,
249 .parent_viewport_watcher = watcher_koids.second,
253Matcher<std::shared_ptr<FakeTransform>> IsImageLayer(
254 const fuchsia::math::SizeU& layer_size,
256 std::vector<Matcher<fuchsia::ui::composition::HitRegion>>
257 hit_region_matchers) {
258 return Pointee(FieldsAre(
264 Pointee(VariantWith<FakeImage>(FieldsAre(
265 _, IsImageProperties(layer_size),
269 ElementsAreArray(hit_region_matchers)));
272Matcher<std::shared_ptr<FakeTransform>> IsViewportLayer(
273 const fuchsia::ui::views::ViewCreationToken& view_token,
274 const fuchsia::math::SizeU& view_logical_size,
275 const fuchsia::math::Inset& view_inset,
276 const fuchsia::math::Vec& view_translation,
277 const fuchsia::math::VecF& view_scale,
278 const float view_opacity) {
279 return Pointee(FieldsAre(
280 _, view_translation, view_scale,
284 Pointee(VariantWith<FakeViewport>(FieldsAre(
285 _, IsViewportProperties(view_logical_size, view_inset),
291Matcher<std::shared_ptr<FakeTransform>> IsClipTransformLayer(
292 const fuchsia::math::Vec& transform_translation,
293 const fuchsia::math::VecF& transform_scale,
294 std::optional<fuchsia::math::Rect> clip_bounds,
295 Matcher<std::shared_ptr<FakeTransform>> viewport_matcher) {
296 return Pointee(FieldsAre(
297 _, transform_translation, transform_scale,
300 ElementsAre(viewport_matcher),
305Matcher<std::shared_ptr<FakeTransform>> IsInputShield() {
306 return Pointee(AllOf(
314fuchsia::ui::composition::OnNextFrameBeginValues WithPresentCredits(
315 uint32_t additional_present_credits) {
316 fuchsia::ui::composition::OnNextFrameBeginValues
values;
317 values.set_additional_present_credits(additional_present_credits);
318 fuchsia::scenic::scheduling::PresentationInfo info_1;
319 info_1.set_presentation_time(123);
320 std::vector<fuchsia::scenic::scheduling::PresentationInfo> infos;
321 infos.push_back(std::move(info_1));
322 values.set_future_presentation_infos(std::move(infos));
326void DrawSimpleFrame(ExternalViewEmbedder& external_view_embedder,
330 external_view_embedder.BeginFrame(
nullptr,
nullptr);
331 external_view_embedder.PrepareFlutterView(frame_size, frame_dpr);
334 external_view_embedder.PostPrerollAction(
nullptr);
335 draw_callback(root_canvas);
337 external_view_embedder.EndFrame(
false,
nullptr);
340 external_view_embedder.SubmitFlutterView(
342 std::make_unique<flutter::SurfaceFrame>(
343 nullptr, std::move(framebuffer_info),
349void DrawFrameWithView(
350 ExternalViewEmbedder& external_view_embedder,
357 external_view_embedder.BeginFrame(
nullptr,
nullptr);
358 external_view_embedder.PrepareFlutterView(frame_size, frame_dpr);
361 external_view_embedder.PrerollCompositeEmbeddedView(
362 view_id, std::make_unique<flutter::EmbeddedViewParams>(view_params));
363 external_view_embedder.PostPrerollAction(
nullptr);
364 background_draw_callback(root_canvas);
366 external_view_embedder.CompositeEmbeddedView(view_id);
367 overlay_draw_callback(overlay_canvas);
369 external_view_embedder.EndFrame(
false,
nullptr);
372 external_view_embedder.SubmitFlutterView(
374 std::make_unique<flutter::SurfaceFrame>(
375 nullptr, std::move(framebuffer_info),
386 : session_subloop_(loop_.StartNewLoop()),
387 flatland_connection_(CreateFlatlandConnection()),
388 fake_surface_producer_(
389 std::make_shared<FakeSurfaceProducer>(CreateFlatlandAllocator())) {}
392 async::TestLoop&
loop() {
return loop_; }
395 return fake_surface_producer_;
401 return flatland_connection_;
405 fuchsia::ui::composition::AllocatorHandle CreateFlatlandAllocator() {
407 fuchsia::ui::composition::AllocatorHandle flatland_allocator =
410 return flatland_allocator;
413 std::shared_ptr<FlatlandConnection> CreateFlatlandConnection() {
415 fuchsia::ui::composition::FlatlandHandle flatland =
418 const auto test_name =
419 ::testing::UnitTest::GetInstance()->current_test_info()->name();
420 return std::make_shared<FlatlandConnection>(
421 std::move(test_name), std::move(flatland),
422 [] {
FAIL(); }, [](
auto...) {});
430 async::TestLoop loop_;
431 std::unique_ptr<async::LoopInterface> session_subloop_;
433 FakeFlatland fake_flatland_;
435 std::shared_ptr<FlatlandConnection> flatland_connection_;
436 std::shared_ptr<FakeSurfaceProducer> fake_surface_producer_;
440 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
441 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
442 fuchsia::ui::views::ViewCreationToken view_creation_token;
443 fuchsia::ui::views::ViewRef view_ref_clone;
445 0u, &viewport_creation_token.value, &view_creation_token.value);
446 ASSERT_EQ(view_creation_token_status, ZX_OK);
448 fuchsia::ui::views::ViewRefControl view_ref_control;
449 fuchsia::ui::views::ViewRef view_ref;
451 0u, &view_ref_control.reference, &view_ref.reference);
452 ASSERT_EQ(status, ZX_OK);
453 view_ref_control.reference.replace(
454 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
455 &view_ref_control.reference);
456 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
457 view_ref.Clone(&view_ref_clone);
460 std::move(view_creation_token),
461 fuchsia::ui::views::ViewIdentityOnCreation{
462 .view_ref = std::move(view_ref),
463 .view_ref_control = std::move(view_ref_control),
465 fuchsia::ui::composition::ViewBoundProtocols{},
466 parent_viewport_watcher.NewRequest(), flatland_connection(),
467 fake_surface_producer());
468 EXPECT_THAT(fake_flatland().graph(), IsEmptyGraph());
472 loop().RunUntilIdle();
473 EXPECT_THAT(fake_flatland().graph(), IsEmptyGraph());
476 flatland_connection()->Present();
477 loop().RunUntilIdle();
478 EXPECT_THAT(fake_flatland().graph(),
479 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
484 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
485 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
486 fuchsia::ui::views::ViewCreationToken view_creation_token;
487 fuchsia::ui::views::ViewRef view_ref_clone;
489 0u, &viewport_creation_token.value, &view_creation_token.value);
490 ASSERT_EQ(view_creation_token_status, ZX_OK);
492 fuchsia::ui::views::ViewRefControl view_ref_control;
493 fuchsia::ui::views::ViewRef view_ref;
495 0u, &view_ref_control.reference, &view_ref.reference);
496 ASSERT_EQ(status, ZX_OK);
497 view_ref_control.reference.replace(
498 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
499 &view_ref_control.reference);
500 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
501 view_ref.Clone(&view_ref_clone);
506 std::move(view_creation_token),
507 fuchsia::ui::views::ViewIdentityOnCreation{
508 .view_ref = std::move(view_ref),
509 .view_ref_control = std::move(view_ref_control),
511 fuchsia::ui::composition::ViewBoundProtocols{},
512 parent_viewport_watcher.NewRequest(), flatland_connection(),
513 fake_surface_producer());
514 flatland_connection()->Present();
515 loop().RunUntilIdle();
516 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
517 loop().RunUntilIdle();
518 EXPECT_THAT(fake_flatland().graph(),
519 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
524 const fuchsia::math::SizeU frame_size{
525 static_cast<uint32_t
>(frame_size_signed.
width()),
526 static_cast<uint32_t
>(frame_size_signed.
height())};
527 DrawSimpleFrame(external_view_embedder, frame_size_signed, 1.f,
530 const SkSize canvas_size =
535 canvas_size.
height() / 2.f);
538 canvas_size.
height() / 32.f),
541 EXPECT_THAT(fake_flatland().graph(),
542 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
546 loop().RunUntilIdle();
549 fake_flatland().graph(),
551 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
554 frame_size, kFirstLayerBlendMode,
561 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
565 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
566 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
567 fuchsia::ui::views::ViewCreationToken view_creation_token;
568 fuchsia::ui::views::ViewRef view_ref_clone;
570 0u, &viewport_creation_token.value, &view_creation_token.value);
571 ASSERT_EQ(view_creation_token_status, ZX_OK);
573 fuchsia::ui::views::ViewRefControl view_ref_control;
574 fuchsia::ui::views::ViewRef view_ref;
576 0u, &view_ref_control.reference, &view_ref.reference);
577 ASSERT_EQ(status, ZX_OK);
578 view_ref_control.reference.replace(
579 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
580 &view_ref_control.reference);
581 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
582 view_ref.Clone(&view_ref_clone);
587 std::move(view_creation_token),
588 fuchsia::ui::views::ViewIdentityOnCreation{
589 .view_ref = std::move(view_ref),
590 .view_ref_control = std::move(view_ref_control),
592 fuchsia::ui::composition::ViewBoundProtocols{},
593 parent_viewport_watcher.NewRequest(), flatland_connection(),
594 fake_surface_producer());
595 flatland_connection()->Present();
596 loop().RunUntilIdle();
597 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
598 loop().RunUntilIdle();
599 EXPECT_THAT(fake_flatland().graph(),
600 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
605 const fuchsia::math::SizeU child_view_size{
606 static_cast<uint32_t
>(child_view_size_signed.
width()),
607 static_cast<uint32_t
>(child_view_size_signed.
height())};
609 const uint32_t child_view_id = child_viewport_token.value.get();
611 const int kOpacity = 200;
612 const float kOpacityFloat = 200 / 255.0f;
613 const fuchsia::math::VecF
kScale{3.0f, 4.0f};
620 mutators_stack.PushOpacity(kOpacity);
621 mutators_stack.PushTransform(
matrix);
625 external_view_embedder.CreateView(
626 child_view_id, []() {},
627 [](fuchsia::ui::composition::ContentId,
628 fuchsia::ui::composition::ChildViewWatcherHandle) {});
630 const fuchsia::math::Inset child_view_inset{
631 static_cast<int32_t
>(child_view_occlusion_hint.
top()),
632 static_cast<int32_t
>(child_view_occlusion_hint.
right()),
633 static_cast<int32_t
>(child_view_occlusion_hint.
bottom()),
634 static_cast<int32_t
>(child_view_occlusion_hint.
left())};
635 external_view_embedder.SetViewProperties(
636 child_view_id, child_view_occlusion_hint,
false,
640 const float kDPR = 2.0f;
641 const float kInvDPR = 1.f / kDPR;
645 const fuchsia::math::SizeU frame_size{
646 static_cast<uint32_t
>(frame_size_signed.
width()),
647 static_cast<uint32_t
>(frame_size_signed.
height())};
649 external_view_embedder, frame_size_signed, kDPR, child_view_id,
653 const SkSize canvas_size =
658 canvas_size.
height() / 2.f);
660 canvas_size.
height() / 32.f),
665 const SkSize canvas_size =
670 canvas_size.
height() / 2.f);
672 canvas_size.
height() / 32.f),
675 EXPECT_THAT(fake_flatland().graph(),
676 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
680 loop().RunUntilIdle();
681 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
682 loop().RunUntilIdle();
685 fake_flatland().graph(),
687 parent_viewport_watcher, viewport_creation_token,
690 frame_size, kFirstLayerBlendMode,
697 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
698 IsViewportLayer(child_view_token, child_view_size, child_view_inset,
699 {0, 0},
kScale, kOpacityFloat),
701 frame_size, kUpperLayerBlendMode,
708 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})},
709 {kInvDPR, kInvDPR}));
712 external_view_embedder.DestroyView(
713 child_view_id, [](fuchsia::ui::composition::ContentId) {});
715 fake_flatland().graph(),
717 parent_viewport_watcher, viewport_creation_token,
720 frame_size, kFirstLayerBlendMode,
727 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
728 IsViewportLayer(child_view_token, child_view_size, child_view_inset,
729 {0, 0},
kScale, kOpacityFloat),
731 frame_size, kUpperLayerBlendMode,
738 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})},
739 {kInvDPR, kInvDPR}));
742 DrawSimpleFrame(external_view_embedder, frame_size_signed, 1.f,
745 const SkSize canvas_size =
750 canvas_size.
height() / 2.f);
753 canvas_size.
height() / 32.f),
757 fake_flatland().graph(),
759 parent_viewport_watcher, viewport_creation_token,
762 frame_size, kFirstLayerBlendMode,
769 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
770 IsViewportLayer(child_view_token, child_view_size, child_view_inset,
771 {0, 0},
kScale, kOpacityFloat),
773 frame_size, kUpperLayerBlendMode,
780 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})},
781 {kInvDPR, kInvDPR}));
784 loop().RunUntilIdle();
786 fake_flatland().graph(),
788 parent_viewport_watcher, viewport_creation_token,
791 frame_size, kFirstLayerBlendMode,
798 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
802 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
803 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
804 fuchsia::ui::views::ViewCreationToken view_creation_token;
805 fuchsia::ui::views::ViewRef view_ref_clone;
807 0u, &viewport_creation_token.value, &view_creation_token.value);
808 ASSERT_EQ(view_creation_token_status, ZX_OK);
810 fuchsia::ui::views::ViewRefControl view_ref_control;
811 fuchsia::ui::views::ViewRef view_ref;
813 0u, &view_ref_control.reference, &view_ref.reference);
814 ASSERT_EQ(status, ZX_OK);
815 view_ref_control.reference.replace(
816 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
817 &view_ref_control.reference);
818 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
819 view_ref.Clone(&view_ref_clone);
824 std::move(view_creation_token),
825 fuchsia::ui::views::ViewIdentityOnCreation{
826 .view_ref = std::move(view_ref),
827 .view_ref_control = std::move(view_ref_control),
829 fuchsia::ui::composition::ViewBoundProtocols{},
830 parent_viewport_watcher.NewRequest(), flatland_connection(),
831 fake_surface_producer());
832 flatland_connection()->Present();
833 loop().RunUntilIdle();
834 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
835 loop().RunUntilIdle();
836 EXPECT_THAT(fake_flatland().graph(),
837 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
842 const fuchsia::math::SizeU child_view_size{
843 static_cast<uint32_t
>(child_view_size_signed.
width()),
844 static_cast<uint32_t
>(child_view_size_signed.
height())};
846 const uint32_t child_view_id = child_viewport_token.value.get();
848 const int kOpacity = 200;
849 const float kOpacityFloat = 200 / 255.0f;
850 const fuchsia::math::VecF
kScale{3.0f, 4.0f};
851 const int kTranslateX = 10;
852 const int kTranslateY = 20;
857 matrix.setTranslateX(kTranslateX);
858 matrix.setTranslateY(kTranslateY);
862 child_view_size_signed.
height() - 60);
866 static_cast<int32_t
>(
kClipRect.height())};
869 mutators_stack.PushOpacity(kOpacity);
870 mutators_stack.PushTransform(
matrix);
875 external_view_embedder.CreateView(
876 child_view_id, []() {},
877 [](fuchsia::ui::composition::ContentId,
878 fuchsia::ui::composition::ChildViewWatcherHandle) {});
880 const fuchsia::math::Inset child_view_inset{
881 static_cast<int32_t
>(child_view_occlusion_hint.
top()),
882 static_cast<int32_t
>(child_view_occlusion_hint.
right()),
883 static_cast<int32_t
>(child_view_occlusion_hint.
bottom()),
884 static_cast<int32_t
>(child_view_occlusion_hint.
left())};
885 external_view_embedder.SetViewProperties(
886 child_view_id, child_view_occlusion_hint,
false,
890 const float kDPR = 2.0f;
891 const float kInvDPR = 1.f / kDPR;
895 const fuchsia::math::SizeU frame_size{
896 static_cast<uint32_t
>(frame_size_signed.
width()),
897 static_cast<uint32_t
>(frame_size_signed.
height())};
899 external_view_embedder, frame_size_signed, kDPR, child_view_id,
903 const SkSize canvas_size =
908 canvas_size.
height() / 2.f);
910 canvas_size.
height() / 32.f),
915 const SkSize canvas_size =
920 canvas_size.
height() / 2.f);
922 canvas_size.
height() / 32.f),
925 EXPECT_THAT(fake_flatland().graph(),
926 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
930 loop().RunUntilIdle();
931 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
932 loop().RunUntilIdle();
935 fake_flatland().graph(),
937 parent_viewport_watcher, viewport_creation_token,
940 frame_size, kFirstLayerBlendMode,
947 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
948 IsClipTransformLayer(
949 {kTranslateX, kTranslateY},
kScale, kClipInMathRect,
950 IsViewportLayer(child_view_token, child_view_size,
951 child_view_inset, {0, 0},
954 frame_size, kUpperLayerBlendMode,
961 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})},
962 {kInvDPR, kInvDPR}));
967 new_matrix.setScaleX(
kScale.x);
968 new_matrix.setScaleY(
kScale.y);
970 new_mutators_stack.PushOpacity(kOpacity);
971 new_mutators_stack.PushTransform(new_matrix);
973 new_matrix, child_view_size_signed, new_mutators_stack);
975 external_view_embedder, frame_size_signed, kDPR, child_view_id,
976 new_child_view_params,
979 const SkSize canvas_size =
984 canvas_size.
height() / 2.f);
986 canvas_size.
height() / 32.f),
991 const SkSize canvas_size =
996 canvas_size.
height() / 2.f);
998 canvas_size.
height() / 32.f),
1001 loop().RunUntilIdle();
1002 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1003 loop().RunUntilIdle();
1005 fake_flatland().graph(),
1007 parent_viewport_watcher, viewport_creation_token,
1010 frame_size, kFirstLayerBlendMode,
1017 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1018 IsViewportLayer(child_view_token, child_view_size, child_view_inset,
1019 {0, 0},
kScale, kOpacityFloat),
1021 frame_size, kUpperLayerBlendMode,
1028 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})},
1029 {kInvDPR, kInvDPR}));
1032 external_view_embedder.DestroyView(
1033 child_view_id, [](fuchsia::ui::composition::ContentId) {});
1034 DrawSimpleFrame(external_view_embedder, frame_size_signed, 1.f,
1037 const SkSize canvas_size =
1042 canvas_size.
height() / 2.f);
1045 canvas_size.
height() / 32.f),
1048 loop().RunUntilIdle();
1050 fake_flatland().graph(),
1052 parent_viewport_watcher, viewport_creation_token,
1055 frame_size, kFirstLayerBlendMode,
1062 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1066 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
1067 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
1068 fuchsia::ui::views::ViewCreationToken view_creation_token;
1069 fuchsia::ui::views::ViewRef view_ref_clone;
1071 0u, &viewport_creation_token.value, &view_creation_token.value);
1072 ASSERT_EQ(view_creation_token_status, ZX_OK);
1074 fuchsia::ui::views::ViewRefControl view_ref_control;
1075 fuchsia::ui::views::ViewRef view_ref;
1077 0u, &view_ref_control.reference, &view_ref.reference);
1078 ASSERT_EQ(status, ZX_OK);
1079 view_ref_control.reference.replace(
1080 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
1081 &view_ref_control.reference);
1082 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
1083 view_ref.Clone(&view_ref_clone);
1088 std::move(view_creation_token),
1089 fuchsia::ui::views::ViewIdentityOnCreation{
1090 .view_ref = std::move(view_ref),
1091 .view_ref_control = std::move(view_ref_control),
1093 fuchsia::ui::composition::ViewBoundProtocols{},
1094 parent_viewport_watcher.NewRequest(), flatland_connection(),
1095 fake_surface_producer());
1096 flatland_connection()->Present();
1097 loop().RunUntilIdle();
1098 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1099 loop().RunUntilIdle();
1100 EXPECT_THAT(fake_flatland().graph(),
1101 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1106 const fuchsia::math::SizeU child_view_size{
1107 static_cast<uint32_t
>(child_view_size_signed.
width()),
1108 static_cast<uint32_t
>(child_view_size_signed.
height())};
1110 const uint32_t child_view_id = child_viewport_token.value.get();
1112 const int kOpacity = 125;
1113 const float kOpacityFloat = 125 / 255.0f;
1114 const fuchsia::math::VecF
kScale{2.f, 3.0f};
1121 mutators_stack.PushOpacity(kOpacity);
1122 mutators_stack.PushTransform(
matrix);
1126 external_view_embedder.CreateView(
1127 child_view_id, []() {},
1128 [](fuchsia::ui::composition::ContentId,
1129 fuchsia::ui::composition::ChildViewWatcherHandle) {});
1133 const fuchsia::math::SizeU frame_size{
1134 static_cast<uint32_t
>(frame_size_signed.
width()),
1135 static_cast<uint32_t
>(frame_size_signed.
height())};
1137 external_view_embedder, frame_size_signed, 1.f, child_view_id,
1141 const SkSize canvas_size =
1146 canvas_size.
height() / 2.f);
1148 canvas_size.
height() / 32.f),
1152 EXPECT_THAT(fake_flatland().graph(),
1153 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1157 loop().RunUntilIdle();
1158 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1159 loop().RunUntilIdle();
1161 fake_flatland().graph(),
1163 parent_viewport_watcher, viewport_creation_token,
1166 frame_size, kFirstLayerBlendMode,
1173 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1174 IsViewportLayer(child_view_token, child_view_size,
1179 external_view_embedder.DestroyView(
1180 child_view_id, [](fuchsia::ui::composition::ContentId) {});
1182 fake_flatland().graph(),
1184 parent_viewport_watcher, viewport_creation_token,
1187 frame_size, kFirstLayerBlendMode,
1194 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1195 IsViewportLayer(child_view_token, child_view_size,
1200 DrawSimpleFrame(external_view_embedder, frame_size_signed, 1.f,
1203 const SkSize canvas_size =
1208 canvas_size.
height() / 2.f);
1211 canvas_size.
height() / 32.f),
1216 fake_flatland().graph(),
1218 parent_viewport_watcher, viewport_creation_token,
1221 frame_size, kFirstLayerBlendMode,
1228 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1229 IsViewportLayer(child_view_token, child_view_size,
1234 loop().RunUntilIdle();
1236 fake_flatland().graph(),
1238 parent_viewport_watcher, viewport_creation_token,
1241 frame_size, kFirstLayerBlendMode,
1248 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1252 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
1253 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
1254 fuchsia::ui::views::ViewCreationToken view_creation_token;
1255 fuchsia::ui::views::ViewRef view_ref_clone;
1257 0u, &viewport_creation_token.value, &view_creation_token.value);
1258 ASSERT_EQ(view_creation_token_status, ZX_OK);
1260 fuchsia::ui::views::ViewRefControl view_ref_control;
1261 fuchsia::ui::views::ViewRef view_ref;
1263 0u, &view_ref_control.reference, &view_ref.reference);
1264 ASSERT_EQ(status, ZX_OK);
1265 view_ref_control.reference.replace(
1266 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
1267 &view_ref_control.reference);
1268 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
1269 view_ref.Clone(&view_ref_clone);
1274 std::move(view_creation_token),
1275 fuchsia::ui::views::ViewIdentityOnCreation{
1276 .view_ref = std::move(view_ref),
1277 .view_ref_control = std::move(view_ref_control),
1279 fuchsia::ui::composition::ViewBoundProtocols{},
1280 parent_viewport_watcher.NewRequest(), flatland_connection(),
1281 fake_surface_producer());
1282 flatland_connection()->Present();
1283 loop().RunUntilIdle();
1284 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1285 loop().RunUntilIdle();
1286 EXPECT_THAT(fake_flatland().graph(),
1287 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1292 const uint32_t child_view_id = child_viewport_token.value.get();
1293 external_view_embedder.CreateView(
1294 child_view_id, []() {},
1295 [](fuchsia::ui::composition::ContentId,
1296 fuchsia::ui::composition::ChildViewWatcherHandle) {});
1300 const fuchsia::math::SizeU frame_size{
1301 static_cast<uint32_t
>(frame_size_signed.
width()),
1302 static_cast<uint32_t
>(frame_size_signed.
height())};
1303 DrawSimpleFrame(external_view_embedder, frame_size_signed, 1.f,
1306 const SkSize canvas_size =
1311 canvas_size.
height() / 2.f);
1314 canvas_size.
height() / 32.f),
1319 loop().RunUntilIdle();
1320 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1321 loop().RunUntilIdle();
1323 fake_flatland().graph(),
1325 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
1328 frame_size, kFirstLayerBlendMode,
1335 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1338 external_view_embedder.DestroyView(
1339 child_view_id, [](fuchsia::ui::composition::ContentId) {});
1341 fake_flatland().graph(),
1343 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
1346 frame_size, kFirstLayerBlendMode,
1353 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1358 const fuchsia::math::SizeU new_frame_size{
1359 static_cast<uint32_t
>(new_frame_size_signed.
width()),
1360 static_cast<uint32_t
>(new_frame_size_signed.
height())};
1361 DrawSimpleFrame(external_view_embedder, new_frame_size_signed, 1.f,
1364 const SkSize canvas_size =
1369 canvas_size.
height() / 2.f);
1372 canvas_size.
height() / 32.f),
1376 fake_flatland().graph(),
1378 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
1381 frame_size, kFirstLayerBlendMode,
1388 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1391 loop().RunUntilIdle();
1393 fake_flatland().graph(),
1395 parent_viewport_watcher, viewport_creation_token,
1398 new_frame_size, kFirstLayerBlendMode,
1405 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1412 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
1413 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
1414 fuchsia::ui::views::ViewCreationToken view_creation_token;
1415 fuchsia::ui::views::ViewRef view_ref_clone;
1417 0u, &viewport_creation_token.value, &view_creation_token.value);
1418 ASSERT_EQ(view_creation_token_status, ZX_OK);
1420 fuchsia::ui::views::ViewRefControl view_ref_control;
1421 fuchsia::ui::views::ViewRef view_ref;
1423 0u, &view_ref_control.reference, &view_ref.reference);
1424 ASSERT_EQ(status, ZX_OK);
1425 view_ref_control.reference.replace(
1426 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
1427 &view_ref_control.reference);
1428 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
1429 view_ref.Clone(&view_ref_clone);
1434 std::move(view_creation_token),
1435 fuchsia::ui::views::ViewIdentityOnCreation{
1436 .view_ref = std::move(view_ref),
1437 .view_ref_control = std::move(view_ref_control),
1439 fuchsia::ui::composition::ViewBoundProtocols{},
1440 parent_viewport_watcher.NewRequest(), flatland_connection(),
1441 fake_surface_producer());
1442 flatland_connection()->Present();
1443 loop().RunUntilIdle();
1444 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1445 loop().RunUntilIdle();
1446 EXPECT_THAT(fake_flatland().graph(),
1447 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1452 const fuchsia::math::SizeU frame_size{
1453 static_cast<uint32_t
>(frame_size_signed.
width()),
1454 static_cast<uint32_t
>(frame_size_signed.
height())};
1456 external_view_embedder, frame_size_signed, 1.f,
1459 const SkSize canvas_size =
1462 SkRect paint_region_1, paint_region_2;
1465 canvas_size.
width() / 4.f, canvas_size.
height() / 2.f,
1466 canvas_size.
width() / 32.f, canvas_size.
height() / 32.f);
1470 canvas->
DrawRect(paint_region_1, rect_paint);
1473 canvas_size.
width() * 3.f / 4.f, canvas_size.
height() / 2.f,
1474 canvas_size.
width() / 32.f, canvas_size.
height() / 32.f);
1477 canvas->
DrawRect(paint_region_2, rect_paint);
1479 EXPECT_THAT(fake_flatland().graph(),
1480 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1484 loop().RunUntilIdle();
1487 fake_flatland().graph(),
1489 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
1492 frame_size, kFirstLayerBlendMode,
1499 fuchsia::ui::composition::HitTestInteraction::DEFAULT),
1506 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1514 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
1515 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
1516 fuchsia::ui::views::ViewCreationToken view_creation_token;
1517 fuchsia::ui::views::ViewRef view_ref_clone;
1519 0u, &viewport_creation_token.value, &view_creation_token.value);
1520 ASSERT_EQ(view_creation_token_status, ZX_OK);
1522 fuchsia::ui::views::ViewRefControl view_ref_control;
1523 fuchsia::ui::views::ViewRef view_ref;
1525 0u, &view_ref_control.reference, &view_ref.reference);
1526 ASSERT_EQ(status, ZX_OK);
1527 view_ref_control.reference.replace(
1528 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
1529 &view_ref_control.reference);
1530 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
1531 view_ref.Clone(&view_ref_clone);
1536 std::move(view_creation_token),
1537 fuchsia::ui::views::ViewIdentityOnCreation{
1538 .view_ref = std::move(view_ref),
1539 .view_ref_control = std::move(view_ref_control),
1541 fuchsia::ui::composition::ViewBoundProtocols{},
1542 parent_viewport_watcher.NewRequest(), flatland_connection(),
1543 fake_surface_producer());
1544 flatland_connection()->Present();
1545 loop().RunUntilIdle();
1546 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1547 loop().RunUntilIdle();
1548 EXPECT_THAT(fake_flatland().graph(),
1549 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1554 const fuchsia::math::SizeU frame_size{
1555 static_cast<uint32_t
>(frame_size_signed.
width()),
1556 static_cast<uint32_t
>(frame_size_signed.
height())};
1558 external_view_embedder, frame_size_signed, 1.f,
1561 const SkSize canvas_size =
1564 SkRect paint_region_1, paint_region_2;
1567 canvas_size.
width() / 4.f, canvas_size.
height() / 2.f,
1568 3.f * canvas_size.
width() / 8.f, canvas_size.
height() / 4.f);
1572 canvas->
DrawRect(paint_region_1, rect_paint);
1575 canvas_size.
width() * 3.f / 8.f, canvas_size.
height() / 2.f,
1576 3.f * canvas_size.
width() / 8.f, canvas_size.
height() / 4.f);
1579 canvas->
DrawRect(paint_region_2, rect_paint);
1581 EXPECT_THAT(fake_flatland().graph(),
1582 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1586 loop().RunUntilIdle();
1589 fake_flatland().graph(),
1591 parent_viewport_watcher, viewport_creation_token, view_ref_clone,
1594 frame_size, kFirstLayerBlendMode,
1601 fuchsia::ui::composition::HitTestInteraction::DEFAULT)})}));
1605 fuchsia::ui::composition::ParentViewportWatcherPtr parent_viewport_watcher;
1606 fuchsia::ui::views::ViewportCreationToken viewport_creation_token;
1607 fuchsia::ui::views::ViewCreationToken view_creation_token;
1608 fuchsia::ui::views::ViewRef view_ref_clone;
1610 0u, &viewport_creation_token.value, &view_creation_token.value);
1611 ASSERT_EQ(view_creation_token_status, ZX_OK);
1613 fuchsia::ui::views::ViewRefControl view_ref_control;
1614 fuchsia::ui::views::ViewRef view_ref;
1616 0u, &view_ref_control.reference, &view_ref.reference);
1617 ASSERT_EQ(status, ZX_OK);
1618 view_ref_control.reference.replace(
1619 ZX_DEFAULT_EVENTPAIR_RIGHTS & (~ZX_RIGHT_DUPLICATE),
1620 &view_ref_control.reference);
1621 view_ref.reference.replace(ZX_RIGHTS_BASIC, &view_ref.reference);
1622 view_ref.Clone(&view_ref_clone);
1627 std::move(view_creation_token),
1628 fuchsia::ui::views::ViewIdentityOnCreation{
1629 .view_ref = std::move(view_ref),
1630 .view_ref_control = std::move(view_ref_control),
1632 fuchsia::ui::composition::ViewBoundProtocols{},
1633 parent_viewport_watcher.NewRequest(), flatland_connection(),
1634 fake_surface_producer(),
1637 flatland_connection()->Present();
1638 loop().RunUntilIdle();
1639 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1640 loop().RunUntilIdle();
1641 EXPECT_THAT(fake_flatland().graph(),
1642 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1643 view_ref_clone, {IsInputShield()}));
1647 const fuchsia::math::SizeU child_view_size{
1648 static_cast<uint32_t
>(child_view_size_signed.
width()),
1649 static_cast<uint32_t
>(child_view_size_signed.
height())};
1651 const uint32_t child_view_id = child_viewport_token.value.get();
1653 const int kOpacity = 200;
1654 const float kOpacityFloat = 200 / 255.0f;
1655 const fuchsia::math::VecF
kScale{3.0f, 4.0f};
1662 mutators_stack.PushOpacity(kOpacity);
1663 mutators_stack.PushTransform(
matrix);
1667 external_view_embedder.CreateView(
1668 child_view_id, []() {},
1669 [](fuchsia::ui::composition::ContentId,
1670 fuchsia::ui::composition::ChildViewWatcherHandle) {});
1672 const fuchsia::math::Inset child_view_inset{
1673 static_cast<int32_t
>(child_view_occlusion_hint.
top()),
1674 static_cast<int32_t
>(child_view_occlusion_hint.
right()),
1675 static_cast<int32_t
>(child_view_occlusion_hint.
bottom()),
1676 static_cast<int32_t
>(child_view_occlusion_hint.
left())};
1677 external_view_embedder.SetViewProperties(
1678 child_view_id, child_view_occlusion_hint,
false,
1682 const float kDPR = 2.0f;
1683 const float kInvDPR = 1.f / kDPR;
1687 const fuchsia::math::SizeU frame_size{
1688 static_cast<uint32_t
>(frame_size_signed.
width()),
1689 static_cast<uint32_t
>(frame_size_signed.
height())};
1691 external_view_embedder, frame_size_signed, kDPR, child_view_id,
1695 const SkSize canvas_size =
1700 canvas_size.
height() / 2.f);
1702 canvas_size.
height() / 32.f),
1707 const SkSize canvas_size =
1712 canvas_size.
height() / 2.f);
1714 canvas_size.
height() / 32.f),
1717 EXPECT_THAT(fake_flatland().graph(),
1718 IsFlutterGraph(parent_viewport_watcher, viewport_creation_token,
1719 view_ref_clone, {IsInputShield()}));
1722 loop().RunUntilIdle();
1723 fake_flatland().FireOnNextFrameBeginEvent(WithPresentCredits(1u));
1724 loop().RunUntilIdle();
1727 fake_flatland().graph(),
1729 parent_viewport_watcher, viewport_creation_token,
1732 frame_size, kFirstLayerBlendMode,
1739 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1740 IsViewportLayer(child_view_token, child_view_size, child_view_inset,
1741 {0, 0},
kScale, kOpacityFloat),
1743 frame_size, kUpperLayerBlendMode,
1750 fuchsia::ui::composition::HitTestInteraction::DEFAULT)}),
1752 {kInvDPR, kInvDPR}));
static const SkMatrix & I()
Developer-facing API for rendering anything within the engine.
virtual void DrawRect(const SkRect &rect, const DlPaint &paint)=0
virtual SkISize GetBaseLayerSize() const =0
virtual void Translate(SkScalar tx, SkScalar ty)=0
DlPaint & setColor(DlColor color)
~ExternalViewEmbedderTest() override=default
std::shared_ptr< FlatlandConnection > flatland_connection()
FakeFlatland & fake_flatland()
std::shared_ptr< FakeSurfaceProducer > fake_surface_producer()
ExternalViewEmbedderTest()
fuchsia::ui::composition::FlatlandHandle ConnectFlatland(async_dispatcher_t *dispatcher=nullptr)
fuchsia::ui::composition::AllocatorHandle ConnectAllocator(async_dispatcher_t *dispatcher=nullptr)
bool is_allocator_connected() const
bool is_flatland_connected() const
#define FAIL(name, result)
#define FML_LOG(severity)
#define FML_CHECK(condition)
fuchsia::ui::composition::AllocatorPtr flatland_allocator_
Dart_NativeFunction function
static constexpr FlutterViewId kImplicitViewId
unsigned useCenter Optional< SkMatrix > matrix
SK_API sk_sp< SkSurface > Null(int width, int height)
bool Contains(const Container &container, const Value &value)
std::pair< zx_koid_t, zx_koid_t > GetKoids(const ZX &kobj)
TEST_F(FocusDelegateTest, WatchCallbackSeries)
static constexpr fuchsia::ui::composition::HitRegion kInfiniteHitRegion
std::function< void()> ReleaseImageCallback
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 bool Bind(PassBindingsCacheMTL &pass, ShaderStage stage, size_t bind_index, const BufferView &view)
static SkRect inset(const SkRect &r)
bool EMSCRIPTEN_KEEPALIVE IsEmpty(const SkPath &path)
static constexpr SkISize Make(int32_t w, int32_t h)
constexpr int32_t width() const
constexpr int32_t height() const
constexpr float left() const
constexpr float top() const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
constexpr float right() const
static constexpr SkRect MakeWH(float w, float h)
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
constexpr float bottom() const
static constexpr SkSize Make(SkScalar w, SkScalar h)
static constexpr DlColor kRed()
static constexpr DlColor kGreen()
static BufferCollectionTokenPair New()
static constexpr fuchsia::math::RectF kDefaultSampleRegion
static constexpr float kDefaultOpacity
static constexpr fuchsia::math::Inset kDefaultViewportInset
static ViewTokenPair New()