-
Notifications
You must be signed in to change notification settings - Fork 296
Introduce ClipChain #1833
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
Introduce ClipChain #1833
Conversation
I did a bit of performance testing for this change. For nasty situations (a thousand deep nested clip), |
I didn't get to this today, sorry. I'll look at it first thing tomorrow. The CI seems to be failing on mac - it might be a float accuracy issue with the clip changes that requires re-generating the reference images? |
@glennw I'm pretty sure the failure here is due to your recent fix for the behavior of |
OK, I'll hold off on reviewing until the updated patch. @kvark pointed out to me that one of my assumptions in that fix was incorrect - so if there's a better way to fix it that still passes the new reftest, go for it. |
@glennw Okay. I think the branch is ready now. The good thing about the change is that now we can start using the |
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.
Looks fine to me, minus one moment.
webrender/src/render_task.rs
Outdated
|
||
// We cannot apply any kind of optimization based on inner rectangles when the | ||
// clips exists in another axis-aligned coordinate system. | ||
if node.work_item.has_compatible_coordinate_system(current_coordinate_system_id) { |
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 this is correct. Inner rects are valid regardless of the coordinate systems.
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.
This is just a replacement for the workaround in #1820. Would it be better for me to add a FIXME and open an issue?
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.
yes, please
This looks good to me - but we should do a gecko/servo try run before merging too. |
☔ The latest upstream changes (presumably #1845) made this pull request unmergeable. Please resolve the merge conflicts. |
Here's the try run for this PR: https://treeherder.mozilla.org/#/jobs?repo=try&revision=8e48d88f50d99977ba93d86b7a36dd9c58c9d5cd&selectedJob=136489766 There are a few tests failing, but it seems like the differences are subpixel. Yet, this PR should change rendering at all. I will investigate a bit more. |
@mrobinson Looking at the reference image that was updated here. There appears to be AA being applied along the axis-aligned edges of the rectangle. That shouldn't be occurring - those edges should be pixel perfect. It's quite possible that fixing that will fix the gecko reftest errors, I think. I wonder if an extra clip / mask is being applied that wasn't previously? |
It's probably worth fixing that ref test in wrench before looking into the gecko failures, since they are probably the same issue. |
Okay. After looking at this a bit I found two bugs in my original PR. The first was that the condition for the inner_rect workaround was reversed (!). Additionally the outer bounds of the clip were not being passed properly down the ClipScrollTree hierarchy. I have fixed these issues and have done the rebase. Here is the try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=604e9e610ea14c65039f2a5b9e258ce23585b982&selectedJob=136791157 Of the unexpected results:
|
@mrobinson awesome, thank you! |
📌 Commit fed7c88 has been approved by |
Introduce ClipChain Clip chains are a linked list of ClipWorkItems that are used to avoid having to recalculate the stack of clips necessary to render items when switching between different ClipScrollNodes. The ClipChains are calculated once on a per node basis during update_transform. <!-- 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/1833) <!-- Reviewable:end -->
💔 Test failed - status-travis |
@bors-servo retry |
Introduce ClipChain Clip chains are a linked list of ClipWorkItems that are used to avoid having to recalculate the stack of clips necessary to render items when switching between different ClipScrollNodes. The ClipChains are calculated once on a per node basis during update_transform. <!-- 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/1833) <!-- Reviewable:end -->
💔 Test failed - status-travis |
☔ The latest upstream changes (presumably #1869) made this pull request unmergeable. Please resolve the merge conflicts. |
Clip chains are a linked list of ClipWorkItems that are used to avoid having to recalculate the stack of clips necessary to render items when switching between different ClipScrollNodes. The ClipChains are calculated once on a per node basis during update_transform. In order to make this happen we need to start tracking when ClipScrollNodes share axis-aligned coordinate spaces. We can use these ids to render rectangular clips into masks when necessary.
The failure looks like it was related to the merge conflict. I rebased the branch. |
@bors-servo r=kvark |
📌 Commit 9822f69 has been approved by |
Introduce ClipChain Clip chains are a linked list of ClipWorkItems that are used to avoid having to recalculate the stack of clips necessary to render items when switching between different ClipScrollNodes. The ClipChains are calculated once on a per node basis during update_transform. <!-- 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/1833) <!-- Reviewable:end -->
💔 Test failed - status-travis |
@bors-servo retry
|
Introduce ClipChain Clip chains are a linked list of ClipWorkItems that are used to avoid having to recalculate the stack of clips necessary to render items when switching between different ClipScrollNodes. The ClipChains are calculated once on a per node basis during update_transform. <!-- 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/1833) <!-- Reviewable:end -->
☀️ Test successful - status-appveyor, status-travis |
Clip chains are a linked list of ClipWorkItems that are used to avoid
having to recalculate the stack of clips necessary to render items when
switching between different ClipScrollNodes. The ClipChains are
calculated once on a per node basis during update_transform.
This change is