27 std::unique_ptr<MockSnapshotDelegate> snapshot_delegate;
30 snapshot_delegate = std::make_unique<MockSnapshotDelegate>();
32 ON_CALL(*snapshot_delegate, GetTextureRegistry())
34 ::testing::Return(snapshot_delegate->GetMockTextureRegistry()));
35 snapshot_delegate_weak_ptr = snapshot_delegate->GetWeakPtr();
40 snapshot_delegate_weak_ptr, task_runner);
43 PostTaskSync(task_runner, [&]() { snapshot_delegate.reset(); });
52 std::unique_ptr<MockSnapshotDelegate> snapshot_delegate;
55 snapshot_delegate = std::make_unique<MockSnapshotDelegate>();
57 ON_CALL(*snapshot_delegate, GetTextureRegistry())
59 ::testing::Return(snapshot_delegate->GetMockTextureRegistry()));
64 auto mock_texture = std::make_shared<impeller::testing::MockTexture>(desc);
66 .WillOnce(::testing::Return(mock_texture));
69 MakeRasterSnapshotSync(::testing::_, ::testing::_, ::testing::_))
71 snapshot_delegate_weak_ptr = snapshot_delegate->GetWeakPtr();
74 sk_sp<DlDeferredImageGPUImpeller>
image;
77 task_runner->PostTask([&latch, &
image]() {
79 EXPECT_FALSE(
image->impeller_texture());
84 snapshot_delegate_weak_ptr, task_runner);
90 EXPECT_TRUE(
image->impeller_texture());
91 snapshot_delegate.reset();
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...