mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] Make Picture::RenderToTexture antialiased on backends that support offscreen MSAA (flutter/engine#36386)
This commit is contained in:
parent
17f163c1b9
commit
1ebaa16813
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user