41 auto native_capture_image_and_picture = [&](Dart_NativeArguments
args) {
42 auto image_handle = Dart_GetNativeArgument(
args, 0);
43 auto native_image_handle =
44 Dart_GetField(image_handle, Dart_NewStringFromCString(
"_image"));
45 ASSERT_FALSE(Dart_IsError(native_image_handle))
46 << Dart_GetError(native_image_handle);
47 ASSERT_FALSE(Dart_IsNull(native_image_handle));
49 Picture* picture = GetNativePeer<Picture>(Dart_GetNativeArgument(
args, 1));
56 auto native_finish = [&](Dart_NativeArguments
args) {
57 message_latch_.Signal();
60 Settings settings = CreateSettingsForFixture();
63 frame_latch.CountDown();
65 auto task_runner = CreateNewThread();
67 GetCurrentTaskRunner(),
73 AddNativeCallback(
"CaptureImageAndPicture",
77 std::unique_ptr<Shell> shell = CreateShell(settings, task_runners);
79 ASSERT_TRUE(shell->IsSetup());
83 shell->GetPlatformView()->NotifyCreated();
86 configuration.SetEntrypoint(
"pumpImage");
88 shell->RunEngine(std::move(configuration), [&](
auto result) {
91 message_latch_.Wait();
93 ASSERT_TRUE(current_display_list_);
94 ASSERT_TRUE(current_image_);
102 message_latch_.Reset();
103 task_runner->PostTask([&, io_manager = shell->GetIOManager()]() {
104 io_manager->GetSkiaUnrefQueue()->Drain();
105 message_latch_.Signal();
107 message_latch_.Wait();
109 if (current_display_list_) {
110 EXPECT_TRUE(current_display_list_->unique());
111 current_display_list_.reset();
114 EXPECT_TRUE(current_image_->unique());
115 current_image_.reset();
117 shell->GetPlatformView()->NotifyDestroyed();
118 DestroyShell(std::move(shell), task_runners);
static RunConfiguration InferFromSettings(const Settings &settings, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer a run configuration from the settings object. This tries to create a run configurat...
static void SetViewportMetrics(JNIEnv *env, jobject jcaller, jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, jint physicalPaddingTop, jint physicalPaddingRight, jint physicalPaddingBottom, jint physicalPaddingLeft, jint physicalViewInsetTop, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft, jint systemGestureInsetTop, jint systemGestureInsetRight, jint systemGestureInsetBottom, jint systemGestureInsetLeft, jint physicalTouchSlop, jintArray javaDisplayFeaturesBounds, jintArray javaDisplayFeaturesType, jintArray javaDisplayFeaturesState)