-
Notifications
You must be signed in to change notification settings - Fork 306
Support multiple composite operations in a StackingContext #802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I've tested this on some basic filter and mix-blend-mode combinations and it seems to work. I used wrench plus the changes in #801. |
|
Reviewed 2 of 3 files at r1. webrender/src/tiling.rs, line 1880 at r1 (raw file):
Let's remove the & and move the CompositeOps here - that will avoid the clone() below. Comments from Reviewable |
|
This looks great! Just one minor issue above. |
|
Review status: 1 of 3 files reviewed at latest revision, 1 unresolved discussion. webrender/src/tiling.rs, line 1880 at r1 (raw file): Previously, glennw (Glenn Watson) wrote…
The &[CompositionOp] was passed into push_layer twice if the stacking context was root with a background color. But I don't think that extra layer needs CompositeOps, so I've removed the & and give that layer CompositeOps::empty(). Comments from Reviewable |
kvark
left a comment
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.
It's nice to see the removal of CompositionOp, which makes things a bit more straightforward. I got a single concern here, and it's not critical.
| let prev_task = mem::replace(&mut current_task, new_task); | ||
| alpha_task_stack.push(prev_task); | ||
| } | ||
| let composite_count = layer.composite_ops.count(); |
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.
why do you need to separate task creation from task initialization (which is happening in PopStackingContext)? Could we have all the logic in one place (in the pop code) instead?
| for filter in &layer.composite_ops.filters { | ||
| let mut prev_task = alpha_task_stack.pop().unwrap(); | ||
| let item = AlphaRenderItem::Blend(sc_index, current_task.id, *filter, next_z); | ||
| next_z += 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 don't think changing the Z makes sense here, given that we are rendering into the task cache and that's not supposed to use the depth test anyway.
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.
The Z is used here when drawing the blend item into the main scene.
|
Review status: 1 of 3 files reviewed at latest revision, 3 unresolved discussions. webrender/src/tiling.rs, line 2595 at r2 (raw file): Previously, kvark (Dzmitry Malyshau) wrote…
The tasks are created here and pushed onto a stack, so that the items in the primitive runs get pushed on to the right task. Or am I completely misunderstanding your comment? :) Comments from Reviewable |
|
☔ The latest upstream changes (presumably #792) made this pull request unmergeable. Please resolve the merge conflicts. |
|
So yes, basically what Glenn said. Tasks need to be created before the following primitive run so the primitives are added to them. And I'm not familiar with how the Z order code is used, but Glenn's comment makes sense. I tried to preserve the original task creation logic. I only extended it so multiple filters on a single stacking context would act like multiple identical stacking contexts with a single filter. |
|
Hmm, so I rebased my branch on the latest master. Not sure why that isn't showing up here. |
|
I'm not sure why appveyor is confused either. Could you try rebasing again, or if it's already up to date, try do just run |
kvark
left a comment
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.
ok, sounds good, thanks for the answers!
|
Okay, that did the trick! |
|
@bors-servo r+ |
|
📌 Commit 4dadd6c has been approved by |
Support multiple composite operations in a StackingContext A StackingContext holds a Vec<FilterOp> and a MixBlendMode, but currently only one operation is applied. This change modifies the render task building code to respect multiple composite operations. It's also careful to apply filters first and then the mix-blend-mode according to the spec. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/802) <!-- Reviewable:end -->
|
@bors-servo r+ |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit 4dadd6c has been approved by |
|
Merging manually - homu is not listening, but travis has passed on both platforms. |
A StackingContext holds a Vec and a MixBlendMode, but currently only one operation is applied. This change modifies the render task building code to respect multiple composite operations. It's also careful to apply filters first and then the mix-blend-mode according to the spec.
This change is