Skip to content
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

Improved Local Combined Clip Rectangle #1374

Merged
merged 4 commits into from Jun 20, 2017
Merged

Improved Local Combined Clip Rectangle #1374

merged 4 commits into from Jun 20, 2017

Conversation

@kvark
Copy link
Member

kvark commented Jun 13, 2017

This PR brings a number of improvements and clean ups related to clipping:

  • new footprint calculation for reference frame's LCCR
  • reworked rectangular region handling for ClipRegion
  • clip regions are included into LCCR
  • primitive bounding rect is computed with the clip stack taken into account
  • clip stack gets filtered based on which clips are not trivial with regards to the current bounding box

TODO: testing, benchmarking, rebasing
Based on #1305

r? @glennw @mrobinson


This change is Reviewable

@kvark kvark force-pushed the kvark:lccr branch from 3019d3d to f5cc341 Jun 13, 2017
@glennw
Copy link
Member

glennw commented Jun 13, 2017

I started doing some testing on this, but it seems to be breaking the scrolling on HN. If you load up https://news.ycombinator.com in Servo with this patch, and scroll to the bottom - parts of the background (and text?) seem to get incorrectly clipped out.

@kvark
Copy link
Member Author

kvark commented Jun 13, 2017

@kvark kvark force-pushed the kvark:lccr branch 6 times, most recently from 915ec5b to 8660bdf Jun 14, 2017
@kvark kvark force-pushed the kvark:lccr branch from 8660bdf to 1338f30 Jun 19, 2017
@kvark kvark changed the title [WIP] New Local Combined Clip Rectangle Improved Local Combined Clip Rectangle Jun 19, 2017
@kvark kvark force-pushed the kvark:lccr branch from 1338f30 to 53a0d89 Jun 19, 2017
@glennw
Copy link
Member

glennw commented Jun 19, 2017

Reviewed 5 of 11 files at r1, 10 of 14 files at r2, 3 of 3 files at r3.
Review status: all files reviewed at latest revision, 5 unresolved discussions.


webrender/src/clip_scroll_node.rs, line 92 at r3 (raw file):

    /// This is in the coordinate system of the node origin.
    /// Precisely, it combines the local clipping rectangles of all the parent
    /// nodes on the way to the root, including those of `ClipRegion`.

This is now a conservative local-space rect, is that right?


webrender/src/mask_cache.rs, line 144 at r3 (raw file):

                ClipSource::Complex(..) => {
                    complex_clip_count += 1;
                },

nit: extra comma


webrender/src/mask_cache.rs, line 307 at r3 (raw file):

    }

    /// Check if this `MaskCacheInfo` actually carries any masks, excluding the layer rectangles.

This comment doesn't seem to match the code below, which does check the layer clip range?


webrender/src/prim_store.rs, line 934 at r3 (raw file):

        if let Some(ref mut clip_info) = metadata.clip_cache_info {
            let bounds = clip_info.update(&metadata.clips,

This seems to be unused.


webrender/src/render_backend.rs, line 71 at r3 (raw file):

    vr_compositor_handler: Arc<Mutex<Option<Box<VRCompositorHandler>>>>,

    // A helper gate to prevent any frames rendering triggered by scrolling

Perhaps expand on what problem this causes if it occurs?


Comments from Reviewable

@glennw
Copy link
Member

glennw commented Jun 19, 2017

Wow, this is complex stuff! It looks good to me though, apart from the few minor issues above.

I've done a bit of local testing - manual page tests seem fine, and the test timings seem as good or better. I did hit a few panics in the CSS tests below - from the test names, I'm guessing we're not correctly handling cases with non-invertible matrices, perhaps?

/css-transforms-1_dev/html/transform3d-scale-004.htm
/css-transforms-1_dev/html/transform-singular-001.htm
/css-transforms-1_dev/html/scale-zero-001.htm
/css-transforms-1_dev/html/css-scale-nested-001.htm

It'd also be good for @mrobinson to take a look over this and see if he can spot anything.

@glennw
Copy link
Member

glennw commented Jun 19, 2017

@mrobinson @kvark We should definitely find a few hours in SF to sit down and talk about clips, masks, scroll nodes etc and work out what the next steps are for this part of the code :)

@kvark
Copy link
Member Author

kvark commented Jun 19, 2017

Thanks for the review, @glennw!
All comments are addressed, CSS tests are passing now, plus some icing on the cake:

PASS [expected FAIL] /css-transforms-1_dev/html/transform-table-006.htm


Review status: 6 of 13 files reviewed at latest revision, 5 unresolved discussions.


webrender/src/clip_scroll_node.rs, line 92 at r3 (raw file):

Previously, glennw (Glenn Watson) wrote…

This is now a conservative local-space rect, is that right?

extended the comment, hopefully it's more clear now


Comments from Reviewable

@kvark
Copy link
Member Author

kvark commented Jun 19, 2017

Hmm, css-transforms1-dev passed but test-wpt has some failures now:

FAIL [expected PASS] /_mozilla/css/iframe/simple_inline_height.html

Looking...

Edit: appears to be (harmlessly?) intermittent, similar to famous hide_and_show.html

@kvark kvark force-pushed the kvark:lccr branch from ebe1c1d to 22b7072 Jun 19, 2017
@glennw glennw self-requested a review Jun 19, 2017
@glennw
glennw approved these changes Jun 19, 2017
@glennw
Copy link
Member

glennw commented Jun 19, 2017

@bors-servo r+

🚢

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2017

📌 Commit 22b7072 has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2017

Testing commit 22b7072 with merge bb36847...

bors-servo added a commit that referenced this pull request Jun 19, 2017
Improved Local Combined Clip Rectangle

This PR brings a number of improvements and clean ups related to clipping:
  - new footprint calculation for reference frame's LCCR
  - reworked rectangular region handling for `ClipRegion`
  - clip regions are included into LCCR
  - primitive bounding rect is computed with the clip stack taken into account
  - clip stack gets filtered based on which clips are not trivial with regards to the current bounding box

~~TODO: testing, benchmarking, rebasing~~
Based on #1305

r? @glennw @mrobinson

<!-- 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/1374)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 20, 2017

☀️ Test successful - status-travis
Approved by: glennw
Pushing bb36847 to master...

@bors-servo bors-servo merged commit 22b7072 into servo:master Jun 20, 2017
2 of 4 checks passed
2 of 4 checks passed
code-review/reviewable 8 files, 5 discussions left (glennw, kvark)
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Thinkofname added a commit to thinklibs/fungui that referenced this pull request Jun 20, 2017
Not to latest though as servo/webrender#1374
seems to be causing issues with clips with stylish.
@staktrace
Copy link
Contributor

staktrace commented Jun 21, 2017

This PR regressed the dom/html/reftests/bug1228601-video-rotation-90.html reftest in gecko. Reftest analyzer link. It might be the same problem as #1408, not sure.

@kvark kvark deleted the kvark:lccr branch Jun 21, 2017
@kvark
Copy link
Member Author

kvark commented Jun 21, 2017

@staktrace very possible. I'm looking at it.

@staktrace
Copy link
Contributor

staktrace commented Jun 25, 2017

@kvark FYI the reftest failure seems to have gone away with #1412 (although now there are a whole bunch of other reftest failures, so it might be that fixing those will restore this failure, not sure)

@staktrace
Copy link
Contributor

staktrace commented Jun 25, 2017

I did a one-line revert of a change in #1412 which fixed the async-scrolling reftest failures. The reftest failure from this PR was not restored as a result, so that's good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.