-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Coerce opaque ColorSourceContents to Source #41525
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,11 @@ void EntityPass::SetDelegate(std::unique_ptr<EntityPassDelegate> delegate) { | |
} | ||
|
||
void EntityPass::AddEntity(Entity entity) { | ||
if (entity.GetBlendMode() == BlendMode::kSourceOver && | ||
entity.GetContents()->IsOpaque()) { | ||
entity.SetBlendMode(BlendMode::kSource); | ||
} | ||
Comment on lines
+51
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this happen before or after we do the opacity peephole check? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This happens before (when Aiks pushes an Entity into the pass). Hmm, it looks like we weren't handling blend modes in the opacity peephole. I added some restrictions and made it so it's able to unfold things with the Source blend mode. There's a new utility where the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like if the pass has kLuminosity as its blend mode and the child entities have kHue, it'll incorrectly collapse the pass. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah nvm about the pass. I think the entities are still not being checked right, though. |
||
|
||
if (entity.GetBlendMode() > Entity::kLastPipelineBlendMode) { | ||
advanced_blend_reads_from_pass_texture_ += 1; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been occasionally using this pattern as a sort of poor man's predicate test for inspecting what Aiks + EntityPass is doing, but I don't think it's a sustainable solution in the longterm. @chinmaygarde recall you writing a doc around this kind of thing many moons ago, but I can't seem to find it...