Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions impeller/display_list/canvas_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,23 @@ std::unique_ptr<Canvas> CreateTestCanvas(
context.GetContext()->GetResourceAllocator()->CreateTexture(
onscreen_desc);

TextureDescriptor onscreen_msaa_desc = onscreen_desc;
onscreen_msaa_desc.sample_count = SampleCount::kCount4;
onscreen_msaa_desc.storage_mode = StorageMode::kDeviceTransient;
onscreen_msaa_desc.type = TextureType::kTexture2DMultisample;

std::shared_ptr<Texture> onscreen_msaa =
context.GetContext()->GetResourceAllocator()->CreateTexture(
onscreen_msaa_desc);

ColorAttachment color0;
color0.resolve_texture = onscreen;
color0.texture = onscreen_msaa;
color0.store_action = StoreAction::kMultisampleResolve;
color0.load_action = LoadAction::kClear;
if (context.GetContext()->GetCapabilities()->SupportsOffscreenMSAA()) {
TextureDescriptor onscreen_msaa_desc = onscreen_desc;
onscreen_msaa_desc.sample_count = SampleCount::kCount4;
onscreen_msaa_desc.storage_mode = StorageMode::kDeviceTransient;
onscreen_msaa_desc.type = TextureType::kTexture2DMultisample;

std::shared_ptr<Texture> onscreen_msaa =
context.GetContext()->GetResourceAllocator()->CreateTexture(
onscreen_msaa_desc);
color0.resolve_texture = onscreen;
color0.texture = onscreen_msaa;
color0.store_action = StoreAction::kMultisampleResolve;
} else {
color0.texture = onscreen;
}

RenderTarget render_target;
render_target.SetColorAttachment(color0, 0);
Expand Down