23 texture_desc.
size = {100, 100};
28 GetContext()->GetResourceAllocator()->CreateTexture(texture_desc);
35 auto content_context = GetContentContext();
36 auto buffer = content_context->GetContext()->CreateCommandBuffer();
38 GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA(
39 *content_context->GetContext(), {100, 100},
41 auto render_pass =
buffer->CreateRenderPass(render_target);
42 auto recording_pass = std::make_shared<RecordingRenderPass>(
43 render_pass, GetContext(), render_target);
45 ASSERT_TRUE(contents.
Render(*GetContentContext(), {}, *recording_pass));
46 const std::vector<Command>& commands = recording_pass->GetCommands();
48 ASSERT_EQ(commands.size(), 1u);
50 EXPECT_TRUE(commands[0].pipeline->GetDescriptor().GetLabel().find(
51 "TextureFill Pipeline") != std::string::npos);
55 EXPECT_EQ(commands[0].pipeline,
56 GetContentContext()->GetTiledTexturePipeline(options));
59 recording_pass->EncodeCommands();
68 <<
"External OES textures are only valid for the OpenGLES backend.";
72 texture_desc.
size = {100, 100};
77 GetContext()->GetResourceAllocator()->CreateTexture(texture_desc);
81 contents->SetStrictSourceRect(
false);
83 auto content_context = GetContentContext();
84 auto buffer = content_context->GetContext()->CreateCommandBuffer();
86 GetContentContext()->GetRenderTargetCache()->CreateOffscreenMSAA(
87 *content_context->GetContext(), {100, 100},
89 auto render_pass =
buffer->CreateRenderPass(render_target);
91 ASSERT_TRUE(contents->Render(*GetContentContext(), {}, *render_pass));
92 const std::vector<Command>& commands = render_pass->GetCommands();
94 ASSERT_EQ(commands.size(), 1u);
98 EXPECT_EQ(commands[0].pipeline,
99 GetContentContext()->GetTiledTextureExternalPipeline(options));
void SetGeometry(const Geometry *geometry)
Set the geometry that this contents will use to render.
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)
PrimitiveType primitive_type
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...