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();
39 builder.
Build(),
size, snapshot_delegate_weak_ptr, task_runner);
42 PostTaskSync(task_runner, [&]() { snapshot_delegate.reset(); });
51 std::unique_ptr<MockSnapshotDelegate> snapshot_delegate;
54 snapshot_delegate = std::make_unique<MockSnapshotDelegate>();
56 ON_CALL(*snapshot_delegate, GetTextureRegistry())
58 ::testing::Return(snapshot_delegate->GetMockTextureRegistry()));
63 auto mock_texture = std::make_shared<impeller::testing::MockTexture>(desc);
65 .WillOnce(::testing::Return(mock_texture));
66 EXPECT_CALL(*snapshot_delegate,
67 MakeRasterSnapshotSync(::testing::_, ::testing::_))
69 snapshot_delegate_weak_ptr = snapshot_delegate->GetWeakPtr();
74 task_runner->PostTask([&latch]() { latch.Wait(); });
77 builder.
Build(),
size, snapshot_delegate_weak_ptr, task_runner);
79 EXPECT_FALSE(
image->impeller_texture());
85 EXPECT_TRUE(
image->impeller_texture());
86 snapshot_delegate.reset();
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...