9 #include "impeller/entity/contents/test/recording_render_pass.h"
14 #include "third_party/googletest/googletest/include/gtest/gtest.h"
23 texture_desc.
size = {100, 100};
28 GetContext()->GetResourceAllocator()->CreateTexture(texture_desc);
34 auto content_context = GetContentContext();
35 auto buffer = content_context->GetContext()->CreateCommandBuffer();
37 GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA(
38 *content_context->GetContext(), {100, 100},
40 auto render_pass = buffer->CreateRenderPass(render_target);
41 auto recording_pass = std::make_shared<RecordingRenderPass>(
42 render_pass, GetContext(), render_target);
44 ASSERT_TRUE(contents.
Render(*GetContentContext(), {}, *recording_pass));
45 const std::vector<Command>& commands = recording_pass->GetCommands();
47 ASSERT_EQ(commands.size(), 1u);
49 EXPECT_TRUE(commands[0].pipeline->GetDescriptor().GetLabel().find(
50 "TextureFill Pipeline") != std::string::npos);
54 EXPECT_EQ(commands[0].pipeline,
55 GetContentContext()->GetTiledTexturePipeline(options));
58 recording_pass->EncodeCommands();
63 #if !defined(FML_OS_MACOSX)
67 <<
"External OES textures are only valid for the OpenGLES backend.";
71 texture_desc.
size = {100, 100};
76 GetContext()->GetResourceAllocator()->CreateTexture(texture_desc);
78 contents->SetTexture(texture);
80 contents->SetStrictSourceRect(
false);
82 auto content_context = GetContentContext();
83 auto buffer = content_context->GetContext()->CreateCommandBuffer();
85 GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA(
86 *content_context->GetContext(), {100, 100},
88 auto render_pass = buffer->CreateRenderPass(render_target);
90 ASSERT_TRUE(contents->Render(*GetContentContext(), {}, *render_pass));
91 const std::vector<Command>& commands = render_pass->GetCommands();
93 ASSERT_EQ(commands.size(), 1u);
97 EXPECT_EQ(commands[0].pipeline,
98 GetContentContext()->GetTiledTextureExternalPipeline(options));
static std::unique_ptr< Geometry > MakeCover()
static std::shared_ptr< TextureContents > MakeRect(Rect destination)
bool Render(const ContentContext &renderer, const Entity &entity, RenderPass &pass) const override
void SetTexture(std::shared_ptr< Texture > texture)
TEST_P(AiksTest, DrawAtlasNoColor)
ContentContextOptions OptionsFromPassAndEntity(const RenderPass &pass, const Entity &entity)
PrimitiveType primitive_type
constexpr static TRect MakeSize(const TSize< U > &size)
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...