-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext. #11946
Conversation
Heads up! This PR modifies the following files:
|
@@ -91,6 +95,9 @@ pub struct SharedLayoutContext { | |||
/// Interface to the font cache thread. | |||
pub font_cache_thread: Mutex<FontCacheThread>, | |||
|
|||
/// A channel used to send the new animations back to layout. | |||
pub new_animations_sender: Mutex<Sender<Animation>>, |
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.
Wait, what's this about? Isn't the whole point to move this to the local context?
Review status: 0 of 12 files reviewed at latest revision, 4 unresolved discussions. components/layout/context.rs, line 99 [r1] (raw file):
|
Review status: 0 of 12 files reviewed at latest revision, 4 unresolved discussions. ports/geckolib/context.rs, line 45 [r1] (raw file):
|
Review status: 0 of 13 files reviewed at latest revision, 4 unresolved discussions. ports/geckolib/context.rs, line 45 [r1] (raw file):
|
Reviewed 5 of 12 files at r1, 7 of 8 files at r2. components/style/context.rs, line 21 [r2] (raw file):
I think I'd rather call this LocalStyleContextCreationInfo instead, given the aforementioned overloading of the word 'data', but I won't insist if it's a pain. components/style/matching.rs, line 376 [r2] (raw file):
Instead of passing both contexts everywhere, why not just pass an implementation of StyleContext, from which both the local and shared contexts can be fetched? Comments from Reviewable |
r=me on the whole patch with those fixes. @bors-servo delegate+ |
✌️ @emilio can now approve this pull request |
…e local StyleContext. As a follow-up, we could move all the data living under a mutex in the SharedLayoutContext only in order to create the local context to the same place. This should increase animation performance when there are multiple animations in one page that happen to be on different threads.
@bors-servo: r=bholley |
📌 Commit 203d2a6 has been approved by |
style: Remove the Mutex from new_animations_sender by moving it to the local StyleContext. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because refactoring. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> As a follow-up, we could move all the data living under a mutex in the SharedLayoutContext only in order to create the local context to the same place. This should increase animation performance when there are multiple animations in one page that happen to be on different threads. r? @SimonSapin/@mbrubeck for the style/layout, @bholley for the geckolib changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11946) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
./mach build -d
does not report any errors./mach test-tidy
does not report any errorsAs a follow-up, we could move all the data living under a mutex in the
SharedLayoutContext only in order to create the local context to the same place.
This should increase animation performance when there are multiple animations in
one page that happen to be on different threads.
r? @SimonSapin/@mbrubeck for the style/layout, @bholley for the geckolib changes
This change is