18 auto coverage =
pass->GetElementsCoverage(std::nullopt);
19 if (!coverage.has_value() || coverage->IsEmpty()) {
25 RenderToTexture(context,
ISize(coverage->GetSize()), translate);
36 auto texture = RenderToTexture(context, size);
40std::shared_ptr<Texture> Picture::RenderToTexture(
43 std::optional<const Matrix> translate)
const {
46 pass->IterateAllEntities([&translate](
auto& entity) ->
bool {
47 auto matrix = translate.has_value()
48 ? translate.value() * entity.GetTransform()
49 : entity.GetTransform();
50 entity.SetTransform(matrix);
56 const std::shared_ptr<Context>& impeller_context = context.
GetContext();
59 RenderTargetAllocator render_target_allocator =
60 RenderTargetAllocator(impeller_context->GetResourceAllocator());
62 if (impeller_context->GetCapabilities()->SupportsOffscreenMSAA()) {
63 target = render_target_allocator.CreateOffscreenMSAA(
67 "Picture Snapshot MSAA",
69 kDefaultColorAttachmentConfigMSAA
72 target = render_target_allocator.CreateOffscreen(
bool Render(const Picture &picture, RenderTarget &render_target, bool reset_host_buffer)
std::shared_ptr< Context > GetContext() const
static constexpr AttachmentConfig kDefaultColorAttachmentConfig
#define FML_DCHECK(condition)
static constexpr Matrix MakeTranslation(const Vector3 &t)
std::shared_ptr< Image > ToImage(AiksContext &context, ISize size) const
std::unique_ptr< EntityPass > pass
std::optional< Snapshot > Snapshot(AiksContext &context)
Represents a texture and its intended draw transform/sampler configuration.
std::shared_ptr< Texture > texture