Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Do not use clear color optimization if the subpass is being collapsed into its parent #43878

Merged
merged 1 commit into from
Jul 21, 2023
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
22 changes: 11 additions & 11 deletions impeller/entity/entity_pass.cc
Original file line number Diff line number Diff line change
Expand Up @@ -604,12 +604,10 @@ bool EntityPass::OnRender(
return false;
}

if (!(GetClearColor(root_pass_size) == Color::BlackTransparent())) {
if (!collapsed_parent_pass &&
!GetClearColor(root_pass_size).IsTransparent()) {
// Force the pass context to create at least one new pass if the clear color
// is present. The `EndPass` first ensures that the clear color will get
// applied even if this EntityPass is getting collapsed into the parent
// pass.
pass_context.EndPass();
// is present.
pass_context.GetRenderPass(pass_depth);
}

Expand Down Expand Up @@ -752,13 +750,15 @@ bool EntityPass::OnRender(
bool is_collapsing_clear_colors = true;
for (const auto& element : elements_) {
// Skip elements that are incorporated into the clear color.
if (is_collapsing_clear_colors) {
auto [entity_color, _] =
ElementAsBackgroundColor(element, root_pass_size);
if (entity_color.has_value()) {
continue;
if (!collapsed_parent_pass) {
if (is_collapsing_clear_colors) {
auto [entity_color, _] =
ElementAsBackgroundColor(element, root_pass_size);
if (entity_color.has_value()) {
continue;
}
is_collapsing_clear_colors = false;
}
is_collapsing_clear_colors = false;
}

EntityResult result =
Expand Down