[Impeller] Make Picture::RenderToTexture antialiased on backends that support offscreen MSAA (flutter/engine#36386)

This commit is contained in:
Dan Field 2022-09-23 14:17:58 -07:00 committed by GitHub
parent 17f163c1b9
commit 1ebaa16813

View File

@ -52,7 +52,13 @@ std::shared_ptr<Texture> Picture::RenderToTexture(
// This texture isn't host visible, but we might want to add host visible
// features to Image someday.
auto target = RenderTarget::CreateOffscreen(*context.GetContext(), size);
auto impeller_context = context.GetContext();
RenderTarget target;
if (impeller_context->SupportsOffscreenMSAA()) {
target = RenderTarget::CreateOffscreenMSAA(*impeller_context, size);
} else {
target = RenderTarget::CreateOffscreen(*impeller_context, size);
}
if (!target.IsValid()) {
VALIDATION_LOG << "Could not create valid RenderTarget.";
return nullptr;