Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImprove the clipping and scrolling API #1428
Conversation
|
@mrobinson Do you have Servo branch with API updates for this and the previous PR? Would be good to be able to do some testing with Servo and land a WR update once this is reviewed and merged. |
|
I've pushed a new commit to this branch and the Servo part of this PR is available here: https://github.com/mrobinson/servo/tree/webrender-update. |
|
|
c3a09cd
to
82a4153
|
I just noticed the reftest failure here. I'm looking at this now. |
Clip coordinates previously used a weird coordinate space relative to the origin of the display item. This was different than every other coordinate specified in the display list, so we smooth over this wrinkle. To do this we need to copy out the complex clips from the auxiliary list and adjust them so that they are relative to the scroll clip node. Fixes #1090. Fixes #1408.
This is a slight revert of the removal of per-item complex clips, but these clips are important for Servo.
This is necessary because of the changes to the API.
|
Okay. The latest version of the PR fixes the typo in the ref test, but one of the jobs seemed to fail due to an error on the bot. I'll rerun that particular configuration. |
|
Reviewed 16 of 27 files at r1, 15 of 15 files at r2, 3 of 3 files at r3. Comments from Reviewable |
|
This seems like a much cleaner API, nice! |
|
Let's get this merged, and try to get both Servo and Gecko updated to the API changes this week :) @bors-servo r+ |
|
|
Improve the clipping and scrolling API This branch includes two improvements to the clipping and scrolling API: 1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent. 2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates. There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs. <!-- 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/1428) <!-- Reviewable:end -->
|
|
|
@bors-servo retry
|
Improve the clipping and scrolling API This branch includes two improvements to the clipping and scrolling API: 1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent. 2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates. There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs. <!-- 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/1428) <!-- Reviewable:end -->
|
|
|
This appears to be broken on nightly due to this change rust-lang/rust#34537 which is causing a compile error in core-text. A change has been made in core-text to fix this servo/core-text-rs@6847e69 but it hasn't been version bumped / published yet. If it requires a major version bump in core-text, that could take quite a while to get all deps updated. Perhaps we could disable building WR on nightly temporarily, since we really need to get this PR (and a few others) landed soon. |
|
#1462 has landed now, which should fix the CI error here. @bors-servo retry |
Improve the clipping and scrolling API This branch includes two improvements to the clipping and scrolling API: 1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent. 2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates. There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs. <!-- 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/1428) <!-- Reviewable:end -->
|
|
mrobinson commentedJun 24, 2017
•
edited by larsbergstrom
This branch includes two improvements to the clipping and scrolling API:
DisplayListBuilder::define_scroll_frameAPI which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent.There are a few other small cleanups included with this, such as remove the
push_clip_nodeandpop_clip_nodeAPIs.This change is