-
Notifications
You must be signed in to change notification settings - Fork 306
Change internal clip sources to be a simple array of clips. #1667
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
Instead of maintaining a copy of a ClipRegion etc, flatten any input clip structures into a list of simple clips. This simplifies some of the mask cache code, and is also prep work for some further simplifications and optimizations to how we handle the mask cache structures.
|
r? @kvark I think this is a net improvement, but it may not be super clear what the benefits are until the follow ups are completed. So we can leave this sit until the rest is done, if you prefer. The main bit to check is the mask_cache |
|
Servo and wrench tests are OK. Gecko try: https://hg.mozilla.org/try/rev/4434224b2b0b2b310b6bd58fcac6caae23d4935a |
| pub enum ClipSource { | ||
| Complex(LayerRect, f32, ClipMode), | ||
| Region(ClipRegion), | ||
| Rectangle(LayerRect), |
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'm glad we are getting rid of the complex clips :)
| match *clip { | ||
| ClipSource::Complex(..) => { | ||
| ClipSource::RoundedRectangle(..) => { | ||
| complex_clip_count += 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 suppose we need to rework the complex_clip_count, at least rename it
| for source in sources { | ||
| match *source { | ||
| ClipSource::Complex(rect, radius, mode) => { | ||
| ClipSource::Image(ref mask) => { |
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.
now that we have 1:1 relationship between local_rect/local_inner modification and a source item, we may go fancy and use fold() here ;)
oh no, sir, it's totally clear that this is a good simplification to me @bors-servo r+ |
|
📌 Commit 94b76a2 has been approved by |
Change internal clip sources to be a simple array of clips. Instead of maintaining a copy of a ClipRegion etc, flatten any input clip structures into a list of simple clips. This simplifies some of the mask cache code, and is also prep work for some further simplifications and optimizations to how we handle the mask cache structures. <!-- 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/1667) <!-- Reviewable:end -->
|
💔 Test failed - status-travis |
@bors-servo retry |
Change internal clip sources to be a simple array of clips. Instead of maintaining a copy of a ClipRegion etc, flatten any input clip structures into a list of simple clips. This simplifies some of the mask cache code, and is also prep work for some further simplifications and optimizations to how we handle the mask cache structures. <!-- 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/1667) <!-- Reviewable:end -->
|
☀️ Test successful - status-travis |
Instead of maintaining a copy of a ClipRegion etc, flatten
any input clip structures into a list of simple clips.
This simplifies some of the mask cache code, and is also
prep work for some further simplifications and optimizations
to how we handle the mask cache structures.
This change is