[Impeller] Skip the color blend in drawVertices when using the destination blend mode (#40891)
[Impeller] Skip the color blend in drawVertices when using the destination blend mode
diff --git a/impeller/entity/contents/vertices_contents.cc b/impeller/entity/contents/vertices_contents.cc
index e996e09..301a70a 100644
--- a/impeller/entity/contents/vertices_contents.cc
+++ b/impeller/entity/contents/vertices_contents.cc
@@ -68,10 +68,16 @@
auto dst_contents = std::make_shared<VerticesColorContents>(*this);
- auto contents = ColorFilterContents::MakeBlend(
- blend_mode_, {FilterInput::Make(dst_contents, false),
- FilterInput::Make(src_contents, false)});
- contents->SetAlpha(alpha_);
+ std::shared_ptr<Contents> contents;
+ if (blend_mode_ == BlendMode::kDestination) {
+ contents = dst_contents;
+ } else {
+ auto color_filter_contents = ColorFilterContents::MakeBlend(
+ blend_mode_, {FilterInput::Make(dst_contents, false),
+ FilterInput::Make(src_contents, false)});
+ color_filter_contents->SetAlpha(alpha_);
+ contents = color_filter_contents;
+ }
return contents->Render(renderer, entity, pass);
}