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

border: Don't always share instances across borders if the instances depend on the available border size. #3067

Merged
merged 1 commit into from Sep 17, 2018

Conversation

@emilio
Copy link
Member

emilio commented Sep 17, 2018

I've added a big comment to BorderRenderTaskInfo with my current understanding
of the invariants this code is trying to preserve.

Please sanity-check it, but I think this patch should both be sound and also
prevent the scrolling-franzine issue
(https://bugzilla.mozilla.org/show_bug.cgi?id=1489644).

Fixes #3058


This change is Reviewable

@@ -528,10 +528,63 @@ pub struct BorderSegmentInfo {
widths: DeviceSize,
}

bitflags! {
/// Whether we depend in the available size for the border (effectively in

This comment has been minimized.

@kvark

kvark Sep 17, 2018

Member

did you mean "depend on" instead of "depend in"?

This comment has been minimized.

@emilio

emilio Sep 17, 2018

Author Member

Yup, will fix.

}

let device_size = (*local_size * scale).to_i32();
if self.available_size_dependence.intersects(AvailableSizeDependence::VERTICAL) {

This comment has been minimized.

@kvark

kvark Sep 17, 2018

Member

nit: use contains?

This comment has been minimized.

@emilio

emilio Sep 17, 2018

Author Member

Will do.

) -> DeviceIntSize {
let mut size = DeviceIntSize::zero();
if self.available_size_dependence.is_empty() {
return size;

This comment has been minimized.

@kvark

kvark Sep 17, 2018

Member

why aren't we returning the *local_size * scale here?

This comment has been minimized.

@emilio

emilio Sep 17, 2018

Author Member

Because for borders where we don't depend on any size we just want the same value for all of them, so they hit the cache and we don't build instances unnecessarily.

This comment has been minimized.

@kvark

kvark Sep 17, 2018

Member

what about a particular width/height then? shouldn't we put 0.0 into width if the key is only height-sensitive?

This comment has been minimized.

@emilio

emilio Sep 17, 2018

Author Member

That's what we do.

This comment has been minimized.

@emilio

emilio Sep 17, 2018

Author Member

Note that we return size instead of device_size. I'm open to suggestions about how to make that clearer.

…depend on the available border size.

I've added a big comment to BorderRenderTaskInfo with my current understanding
of the invariants this code is trying to preserve.

Please sanity-check it, but I think this patch should both be sound and also
prevent the scrolling-franzine issue
(https://bugzilla.mozilla.org/show_bug.cgi?id=1489644).

Fixes #3058
@emilio emilio force-pushed the emilio:border-caching branch from 7ea36a5 to 4aac021 Sep 17, 2018
@emilio
Copy link
Member Author

emilio commented Sep 17, 2018

Comments addressed.

@emilio
Copy link
Member Author

emilio commented Sep 17, 2018

Reftests and such look all green so far, yay :)

@kvark
kvark approved these changes Sep 17, 2018
Copy link
Member

kvark left a comment

Thank you, I'm convinced now :)

@emilio
Copy link
Member Author

emilio commented Sep 17, 2018

@bors-servo r=kvark

@gw3583 feel free to take a quick skim at the changes just to sanity-check, if you want :)

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2018

📌 Commit 4aac021 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Sep 17, 2018

Testing commit 4aac021 with merge 5a1985a...

bors-servo added a commit that referenced this pull request Sep 17, 2018
border: Don't always share instances across borders if the instances depend on the available border size.

I've added a big comment to BorderRenderTaskInfo with my current understanding
of the invariants this code is trying to preserve.

Please sanity-check it, but I think this patch should both be sound and also
prevent the scrolling-franzine issue
(https://bugzilla.mozilla.org/show_bug.cgi?id=1489644).

Fixes #3058

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

bors-servo commented Sep 17, 2018

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: kvark
Pushing 5a1985a to master...

@bors-servo bors-servo merged commit 4aac021 into servo:master Sep 17, 2018
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
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

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