Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCanvas Components for OffscreenCanvas #23381
Conversation
highfive
commented
May 14, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
May 14, 2019
|
Fixing up the members of CanvasState should avoid many errors currently reported by the Rust compiler. In general, we can't store any pointers to objects ( |
| #[ignore_malloc_size_of = "Arc"] | ||
| image_cache: Arc<dyn ImageCache>, | ||
| base_url: ServoUrl, | ||
| global: &GlobalScope, |
This comment has been minimized.
This comment has been minimized.
jdm
May 14, 2019
Member
Remove global and have callers pass in a &GlobalScope argument when necessary.
| #[derive(JSTraceable, MallocSizeOf)] | ||
| pub struct CanvasState { | ||
| #[ignore_malloc_size_of = "Defined in ipc-channel"] | ||
| ipc_renderer: IpcSender<CanvasMsg>, | ||
| canvas_id: CanvasId, | ||
| state: DomRefCell<CanvasContextState>, |
This comment has been minimized.
This comment has been minimized.
jdm
May 14, 2019
Member
We no longer need DomRefCell or Cell in members of CanvasState, since CanvasState is stored in a DomRefCell. We can write methods that require &mut self instead of &self when we need to mutate members now.
| #[derive(JSTraceable, MallocSizeOf)] | ||
| pub struct CanvasState { | ||
| #[ignore_malloc_size_of = "Defined in ipc-channel"] | ||
| ipc_renderer: IpcSender<CanvasMsg>, | ||
| canvas_id: CanvasId, | ||
| state: DomRefCell<CanvasContextState>, | ||
| origin_clean: Cell<bool>, | ||
| canvas: Option<&HTMLCanvasElement>, |
This comment has been minimized.
This comment has been minimized.
jdm
May 14, 2019
Member
Have callers pass in a Option<&HTMLCanvasElement> argument when necessary instead of storing this.
|
A rebase against master will be required. |
|
Error syncing changes upstream. Logs saved in error-snapshot-1558052741634. |
|
I successfully cherry-picked and rebased the changes. |
|
@bors-servo try=wpt |
Canvas Components for OffscreenCanvas <!-- 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 - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23381) <!-- Reviewable:end -->
Thank You Josh! |
|
|
|
@bors-servo r+ |
|
|
Canvas Components for OffscreenCanvas <!-- 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 - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23381) <!-- Reviewable:end -->
|
|
|
linux builders failed with
and Travis complains about tidy
|
|
@bors-servo r+ |
|
|
Canvas Components for OffscreenCanvas <!-- 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 - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23381) <!-- Reviewable:end -->
|
|
|
This is triggering a known edge case in our CI and it's going to be tricky to address. Go ahead and email your professor; don't wait for this PR to finish merging. |
Okay Josh! |
|
@bors-servo r- |
|
@bors-servo r+ |
|
|
Canvas Components for OffscreenCanvas <!-- 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 - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23381) <!-- Reviewable:end -->
|
|
maharsh312 commentedMay 14, 2019
•
edited by jdm
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is