Skip to content

Commit cec8f10

Browse files
author
Jonah Williams
authored
[Impeller] remove unused BliPass::EncodeCommands arg and cleanup. (#160623)
The TransientsAllocator argument to BlitPass::EncodeCommands is completely unused. Delete it (and add a missing IFDEF around the GLES debug labels.).
1 parent 181f424 commit cec8f10

27 files changed

+46
-61
lines changed

engine/src/flutter/impeller/display_list/aiks_dl_basic_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ bool GenerateMipmap(const std::shared_ptr<Context>& context,
105105
}
106106
pass->GenerateMipmap(std::move(texture), label);
107107

108-
pass->EncodeCommands(context->GetResourceAllocator());
108+
pass->EncodeCommands();
109109
return context->GetCommandQueue()->Submit({buffer}).ok();
110110
}
111111

engine/src/flutter/impeller/display_list/aiks_dl_unittests.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ TEST_P(AiksTest, MipmapGenerationWorksCorrectly) {
519519
blit_pass->AddCopy(DeviceBuffer::AsBufferView(std::move(device_buffer)),
520520
texture);
521521
blit_pass->GenerateMipmap(texture);
522-
EXPECT_TRUE(blit_pass->EncodeCommands(GetContext()->GetResourceAllocator()));
522+
EXPECT_TRUE(blit_pass->EncodeCommands());
523523
EXPECT_TRUE(GetContext()->GetCommandQueue()->Submit({command_buffer}).ok());
524524

525525
auto image = DlImageImpeller::Make(texture);
@@ -579,7 +579,7 @@ TEST_P(AiksTest, SetContentsWithRegion) {
579579
IRect::MakeLTRB(50, 50, 150, 150));
580580

581581
auto did_submit =
582-
blit_pass->EncodeCommands(GetContext()->GetResourceAllocator()) &&
582+
blit_pass->EncodeCommands() &&
583583
GetContext()->GetCommandQueue()->Submit({std::move(cmd_buffer)}).ok();
584584
ASSERT_TRUE(did_submit);
585585

engine/src/flutter/impeller/display_list/canvas.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,8 +1671,7 @@ bool Canvas::BlitToOnscreen() {
16711671
auto blit_pass = command_buffer->CreateBlitPass();
16721672
blit_pass->AddCopy(offscreen_target.GetRenderTargetTexture(),
16731673
render_target_.GetRenderTargetTexture());
1674-
if (!blit_pass->EncodeCommands(
1675-
renderer_.GetContext()->GetResourceAllocator())) {
1674+
if (!blit_pass->EncodeCommands()) {
16761675
VALIDATION_LOG << "Failed to encode root pass blit command.";
16771676
return false;
16781677
}

engine/src/flutter/impeller/entity/contents/content_context.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,10 @@ ContentContext::ContentContext(
268268
auto buffer_view = host_buffer.Emplace(data);
269269
blit_pass->AddCopy(buffer_view, empty_texture_);
270270

271-
if (!blit_pass->EncodeCommands(GetContext()->GetResourceAllocator()) ||
272-
!GetContext()
273-
->GetCommandQueue()
274-
->Submit({std::move(cmd_buffer)})
275-
.ok()) {
271+
if (!blit_pass->EncodeCommands() || !GetContext()
272+
->GetCommandQueue()
273+
->Submit({std::move(cmd_buffer)})
274+
.ok()) {
276275
VALIDATION_LOG << "Failed to create empty texture.";
277276
}
278277
}

engine/src/flutter/impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,7 @@ std::optional<Entity> BlendFilterContents::CreateFramebufferAdvancedBlend(
892892
foreground_color->Premultiply().ToR8G8B8A8(), /*alignment=*/4);
893893

894894
blit_pass->AddCopy(std::move(buffer_view), foreground_texture);
895-
if (!blit_pass->EncodeCommands(
896-
renderer.GetContext()->GetResourceAllocator())) {
895+
if (!blit_pass->EncodeCommands()) {
897896
return std::nullopt;
898897
}
899898
}

engine/src/flutter/impeller/entity/contents/gradient_generator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ std::shared_ptr<Texture> CreateGradientTexture(
4141
auto blit_pass = cmd_buffer->CreateBlitPass();
4242
blit_pass->AddCopy(DeviceBuffer::AsBufferView(std::move(buffer)), texture);
4343

44-
if (!blit_pass->EncodeCommands(context->GetResourceAllocator()) ||
44+
if (!blit_pass->EncodeCommands() ||
4545
!context->GetCommandQueue()->Submit({std::move(cmd_buffer)}).ok()) {
4646
return nullptr;
4747
}

engine/src/flutter/impeller/entity/entity_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,7 @@ static std::vector<std::shared_ptr<Texture>> CreateTestYUVTextures(
16461646

16471647
blit_pass->AddCopy(DeviceBuffer::AsBufferView(uv_mapping_buffer), uv_texture);
16481648

1649-
if (!blit_pass->EncodeCommands(context->GetResourceAllocator()) ||
1649+
if (!blit_pass->EncodeCommands() ||
16501650
!context->GetCommandQueue()->Submit({cmd_buffer}).ok()) {
16511651
FML_DLOG(ERROR) << "Could not copy contents into Y/UV texture.";
16521652
}

engine/src/flutter/impeller/golden_tests/vulkan_screenshotter.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
bool success = blit_pass->AddCopy(texture, device_buffer);
4040
FML_CHECK(success);
4141

42-
success = blit_pass->EncodeCommands(surface_context->GetResourceAllocator());
42+
success = blit_pass->EncodeCommands();
4343
FML_CHECK(success);
4444

4545
fml::AutoResetWaitableEvent latch;

engine/src/flutter/impeller/playground/imgui/imgui_impl_impeller.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ bool ImGui_ImplImpeller_Init(
100100

101101
blit_pass->AddCopy(impeller::DeviceBuffer::AsBufferView(device_buffer),
102102
bd->font_texture);
103-
blit_pass->EncodeCommands(context->GetResourceAllocator());
103+
blit_pass->EncodeCommands();
104104

105105
[[maybe_unused]] bool uploaded =
106106
context->GetCommandQueue()->Submit({command_buffer}).ok();

engine/src/flutter/impeller/playground/playground.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ static std::shared_ptr<Texture> CreateTextureForDecompressedImage(
421421
blit_pass->SetLabel("Mipmap Blit Pass");
422422
blit_pass->GenerateMipmap(texture);
423423
}
424-
blit_pass->EncodeCommands(context->GetResourceAllocator());
424+
blit_pass->EncodeCommands();
425425
if (!context->GetCommandQueue()->Submit({command_buffer}).ok()) {
426426
FML_DLOG(ERROR) << "Failed to submit blit pass command buffer.";
427427
return nullptr;
@@ -490,7 +490,7 @@ std::shared_ptr<Texture> Playground::CreateTextureCubeForFixture(
490490
"", /*mip_level=*/0, /*slice=*/i);
491491
}
492492

493-
if (!blit_pass->EncodeCommands(context_->GetResourceAllocator()) ||
493+
if (!blit_pass->EncodeCommands() ||
494494
!context_->GetCommandQueue()->Submit({std::move(cmd_buffer)}).ok()) {
495495
VALIDATION_LOG << "Could not upload texture to device memory.";
496496
return nullptr;

0 commit comments

Comments
 (0)