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

Remove the per-item complex clipping and masking from the API #1412

Merged
merged 1 commit into from Jun 23, 2017

Conversation

@mrobinson
Copy link
Member

mrobinson commented Jun 21, 2017

This is the first step to getting all masking operations into the
ClipScrollTree. We don't completely this feature, as it's still sued
for the extra clips. These will be moved into the ClipScrollTree in a
later change. This change allows us to fully eliminate the
DisplayListBuilder::push_clip_region API and push its functionality
into the define_clip API.

Most of the changes here are:

  1. Changes to the examples, wrench, and reftests to match the new API.
  2. Adapting the "split rectangle clipped by rounded rect"
    optimization to use the ClipScrollTree. This is unfortunately a
    bit more complicated now, but now includes any rounded rect clip
    instead of per-item ones.

This change is Reviewable

@mrobinson mrobinson requested review from glennw and kvark Jun 21, 2017
@mrobinson
Copy link
Member Author

mrobinson commented Jun 21, 2017

Sorry for the large patch, but most of the changes are due to the API change as well as switching two of the examples to use the example boilerplate.

@mrobinson mrobinson force-pushed the mrobinson:remove-per-clip-mask branch from e6bea06 to f5cfc51 Jun 21, 2017
Copy link
Member

kvark left a comment

Why did wrench/reftests/aa/rounded-rects-ref.png change?

Also, perhaps you forgot to remove PrimitiveMetadata::clip_cache_info?

@@ -412,6 +411,38 @@ impl ClipScrollNode {
_ => false,
}
}

pub fn find_unclipped_rectangle(&self,

This comment has been minimized.

@kvark

kvark Jun 21, 2017

Member

It appears to be similar to the MashBounds::inner. Perhaps, you could just use clip_info.mask_cache_info.bounds.inner instead of having a separate method?

This comment has been minimized.

@mrobinson

mrobinson Jun 22, 2017

Author Member

It looks like MaskBounds::inner is using inner_rect_safe() while your optimization is using inner_rect_full(). I confirmed locally that these two methods are producing different rectangles. I'm not sure what is correct here, so would it make sense to try to combine these calculations in a later patch?

@kvark
kvark approved these changes Jun 22, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Jun 22, 2017

The latest upstream changes (presumably #1417) made this pull request unmergeable. Please resolve the merge conflicts.

@mrobinson mrobinson force-pushed the mrobinson:remove-per-clip-mask branch from f5cfc51 to e6228a7 Jun 22, 2017
@kvark
Copy link
Member

kvark commented Jun 22, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jun 22, 2017

📌 Commit e6228a7 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Jun 22, 2017

Testing commit e6228a7 with merge ee59a40...

bors-servo added a commit that referenced this pull request Jun 22, 2017
Remove the per-item complex clipping and masking from the API

This is the first step to getting all masking operations into the
ClipScrollTree. We don't completely this feature, as it's still sued
for the extra clips. These will be moved into the ClipScrollTree in a
later change. This change allows us to fully eliminate the
`DisplayListBuilder::push_clip_region` API and push its functionality
into the `define_clip` API.

Most of the changes here are:
  1. Changes to the examples, wrench, and reftests to match the new API.
  2. Adapting the "split rectangle clipped by rounded rect"
     optimization to use the ClipScrollTree. This is unfortunately a
     bit more complicated now, but now includes any rounded rect clip
     instead of per-item ones.

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

bors-servo commented Jun 22, 2017

💔 Test failed - status-travis

@kvark
Copy link
Member

kvark commented Jun 22, 2017

Something scary is going on:

REFTEST reftests/aa/rounded-rects.yaml == reftests/aa/rounded-rects-ref.png
thread 'RenderBackend' has overflowed its stack
fatal runtime error: stack overflow

This is the first step to getting all masking operations into the
ClipScrollTree. We don't completely this feature, as it's still sued
for the extra clips. These will be moved into the ClipScrollTree in a
later change. This change allows us to fully eliminate the
DisplayListBuilder::push_clip_region API and push its functionality
into the define_clip API.

Most of the changes here are:
  1. Changes to the examples, wrench, and reftests to match the new API.
  2. Adapting the "split rectangle clipped by rounded rect"
     optimization to use the ClipScrollTree. This is unfortunately a
     bit more complicated now, but now includes any rounded rect clip
     instead of per-item ones.
@mrobinson mrobinson force-pushed the mrobinson:remove-per-clip-mask branch from e6228a7 to 0bf6655 Jun 23, 2017
@mrobinson
Copy link
Member Author

mrobinson commented Jun 23, 2017

@kvark This was an issue with the rebase on top of the rust upgrade. It should be fixed now. Sorry for the churn!

@kvark
Copy link
Member

kvark commented Jun 23, 2017

@mrobinson thanks!
@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Jun 23, 2017

📌 Commit 0bf6655 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Jun 23, 2017

Testing commit 0bf6655 with merge df8c508...

bors-servo added a commit that referenced this pull request Jun 23, 2017
Remove the per-item complex clipping and masking from the API

This is the first step to getting all masking operations into the
ClipScrollTree. We don't completely this feature, as it's still sued
for the extra clips. These will be moved into the ClipScrollTree in a
later change. This change allows us to fully eliminate the
`DisplayListBuilder::push_clip_region` API and push its functionality
into the `define_clip` API.

Most of the changes here are:
  1. Changes to the examples, wrench, and reftests to match the new API.
  2. Adapting the "split rectangle clipped by rounded rect"
     optimization to use the ClipScrollTree. This is unfortunately a
     bit more complicated now, but now includes any rounded rect clip
     instead of per-item ones.

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

bors-servo commented Jun 23, 2017

☀️ Test successful - status-travis
Approved by: kvark
Pushing df8c508 to master...

@bors-servo bors-servo merged commit 0bf6655 into servo:master Jun 23, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:remove-per-clip-mask branch Jun 23, 2017
@staktrace
Copy link
Contributor

staktrace commented Jun 25, 2017

@mrobinson FYI the change to only treat non-zero-origin or clip-smaller-than-content clips as scroll frames resulted in a bunch of async-scrolling reftest regressions in gecko (link). Presumably once the API allows us to more explicitly create scroll frames vs non-scrolling clips and we start using that this will not be a problem any more. The patch I applied to verify this can be found here.

@glennw
Copy link
Member

glennw commented Jun 27, 2017

@mrobinson We should discuss the per-item clip stuff in SF - I have a few questions / concerns about possible performance impacts of not supporting extra_clips on items.

staktrace added a commit to staktrace/webrender that referenced this pull request Jul 7, 2017
PR servo#1412 introduced a small semantic change mixed in with the removal of
per-item complex clipping and masking. The semantic change resulted in
numerous Gecko reftest failures as many scroll frames ended up being
treated as clips. Eventually WR will have an explicit API to allow
callers to distinguish scroll frames from clips, but until that is in
place we should maintain the old behaviour of just treating all clips as
potential scroll frames.
@staktrace
Copy link
Contributor

staktrace commented Jul 7, 2017

Presumably once the API allows us to more explicitly create scroll frames vs non-scrolling clips and we start using that this will not be a problem any more.

This is happening in #1428.

bors-servo added a commit that referenced this pull request Dec 21, 2017
Make image mask path optional in YAML reader

Otherwise we crash during "show" command on some frames.
Appears to be broken as of #1412

<!-- 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/2225)
<!-- Reviewable:end -->
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.