7 #include "flutter/testing/testing.h"
8 #include "gtest/gtest.h"
20 if (GetContentContext()
21 ->GetDeviceCapabilities()
22 .SupportsImplicitResolvingMSAA()) {
23 GTEST_SKIP() <<
"Implicit MSAA is used on this device.";
25 auto content_context = GetContentContext();
26 auto buffer = content_context->GetContext()->CreateCommandBuffer();
28 GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA(
29 *content_context->GetContext(), {100, 100},
34 auto color0 = entity_pass_target.GetRenderTarget().GetColorAttachment(0);
35 auto msaa_tex = color0.texture;
36 auto resolve_tex = color0.resolve_texture;
38 FML_DCHECK(content_context);
39 entity_pass_target.Flip(*content_context);
41 color0 = entity_pass_target.GetRenderTarget().GetColorAttachment(0);
43 ASSERT_EQ(msaa_tex, color0.texture);
44 ASSERT_NE(resolve_tex, color0.resolve_texture);
48 auto content_context = GetContentContext();
49 auto buffer = content_context->GetContext()->CreateCommandBuffer();
50 auto context = content_context->GetContext();
51 auto& allocator = *context->GetResourceAllocator();
58 context->GetCapabilities()->GetDefaultColorFormat();
66 color0_tex_desc.
format = pixel_format;
70 auto color0_msaa_tex = allocator.CreateTexture(color0_tex_desc);
77 color0.
texture = color0_msaa_tex;
86 auto color0 = entity_pass_target.GetRenderTarget().GetColorAttachment(0);
87 auto msaa_tex = color0.texture;
88 auto resolve_tex = color0.resolve_texture;
90 ASSERT_EQ(msaa_tex, resolve_tex);
92 FML_DCHECK(content_context);
93 entity_pass_target.Flip(*content_context);
95 color0 = entity_pass_target.GetRenderTarget().GetColorAttachment(0);
97 ASSERT_NE(msaa_tex, color0.texture);
98 ASSERT_NE(resolve_tex, color0.resolve_texture);
99 ASSERT_EQ(color0.texture, color0.resolve_texture);
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
TEST_P(AiksTest, DrawAtlasNoColor)
INSTANTIATE_PLAYGROUND_SUITE(AiksTest)
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
@ kStoreAndMultisampleResolve
std::shared_ptr< Texture > resolve_texture
std::shared_ptr< Texture > texture
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...