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

Canvas Components for OffscreenCanvas #23381

Merged
merged 1 commit into from May 29, 2019

Conversation

Projects
None yet
7 participants
@maharsh312
Copy link
Contributor

commented May 14, 2019


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #___ (GitHub issue number if applicable)
  • There are tests for these changes OR
  • These changes do not require tests because ___

This change is Reviewable

@highfive

This comment has been minimized.

Copy link

commented May 14, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/webidls/OffscreenCanvasRenderingContext2D.webidl, components/script/dom/webidls/CanvasPattern.webidl, components/script/dom/offscreencanvasrenderingcontext2d.rs, components/script/dom/webidls/CanvasGradient.webidl and 1 more
  • @KiChjang: components/script/dom/canvasrenderingcontext2d.rs, components/script/dom/webidls/OffscreenCanvasRenderingContext2D.webidl, components/script/dom/webidls/CanvasPattern.webidl, components/script/dom/offscreencanvasrenderingcontext2d.rs, components/script/dom/webidls/CanvasGradient.webidl and 1 more
@highfive

This comment has been minimized.

Copy link

commented May 14, 2019

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@jdm
Copy link
Member

left a comment

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 (&T), so we should remove them entirely or store types like Dom<T>.

#[ignore_malloc_size_of = "Arc"]
image_cache: Arc<dyn ImageCache>,
base_url: ServoUrl,
global: &GlobalScope,

This comment has been minimized.

Copy link
@jdm

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.

Copy link
@jdm

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.

Copy link
@jdm

jdm May 14, 2019

Member

Have callers pass in a Option<&HTMLCanvasElement> argument when necessary instead of storing this.

@jdm

This comment has been minimized.

Copy link
Member

commented May 16, 2019

A rebase against master will be required.

@jdm jdm added the S-needs-rebase label May 16, 2019

@servo-wpt-sync

This comment has been minimized.

Copy link
Collaborator

commented May 17, 2019

Error syncing changes upstream. Logs saved in error-snapshot-1558052741634.

@jdm jdm force-pushed the maharsh312:master branch from c94b05f to dd08198 May 21, 2019

@jdm jdm removed the S-needs-rebase label May 21, 2019

@jdm jdm force-pushed the maharsh312:master branch from dd08198 to 4c7ddea May 21, 2019

@jdm

This comment has been minimized.

Copy link
Member

commented May 21, 2019

I successfully cherry-picked and rebased the changes.

@jdm

This comment has been minimized.

Copy link
Member

commented May 21, 2019

@bors-servo try=wpt

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

⌛️ Trying commit 4c7ddea with merge f0268a4...

bors-servo added a commit that referenced this pull request May 21, 2019

Auto merge of #23381 - maharsh312:master, r=<try>
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

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2019

I successfully cherry-picked and rebased the changes.

Thank You Josh!

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

💔 Test failed - linux-rel-css

@jdm jdm force-pushed the maharsh312:master branch from 4c7ddea to 4112d1c May 21, 2019

@jdm

This comment has been minimized.

Copy link
Member

commented May 21, 2019

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

📌 Commit 4112d1c has been approved by jdm

bors-servo added a commit that referenced this pull request May 22, 2019

Auto merge of #23381 - maharsh312:master, r=jdm
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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

💔 Test failed - linux-rel-css

@CYBAI

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

linux builders failed with

error: method is never used: `image_cache`
   --> components/script/dom/paintworkletglobalscope.rs:134:5
    |
134 |     pub fn image_cache(&self) -> Arc<dyn ImageCache> {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`

and Travis complains about tidy

$ ./mach test-tidy --no-progress --all
 0:08.35 INFO Diffing old and new manifests /home/travis/build/servo/servo/tests/wpt/mozilla/meta/MANIFEST.json
 0:08.48 WARNING Manifest /home/travis/build/servo/servo/tests/wpt/mozilla/meta/MANIFEST.json contains correct tests but file hashes changed.
 0:08.48 ERROR Manifest /home/travis/build/servo/servo/tests/wpt/mozilla/meta/MANIFEST.json is outdated, use |./mach update-manifest| to fix.
 0:08.48 INFO Diffing old and new manifests /home/travis/build/servo/servo/tests/wpt/metadata/MANIFEST.json
 0:13.72 INFO Diffing old and new manifests /home/travis/build/servo/servo/tests/wpt/webgl/meta/MANIFEST.json

@jdm jdm force-pushed the maharsh312:master branch from fb35747 to 85c20db May 22, 2019

@jdm

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

📌 Commit 85c20db has been approved by jdm

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

⌛️ Testing commit 85c20db with merge 951bfea...

bors-servo added a commit that referenced this pull request May 22, 2019

Auto merge of #23381 - maharsh312:master, r=jdm
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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

💔 Test failed - status-taskcluster

@jdm

This comment has been minimized.

Copy link
Member

commented May 22, 2019

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.

@maharsh312

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2019

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!

@jdm

This comment has been minimized.

Copy link
Member

commented May 24, 2019

@jdm

This comment has been minimized.

Copy link
Member

commented May 29, 2019

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

📌 Commit 85c20db has been approved by jdm

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

⌛️ Testing commit 85c20db with merge 8dc7a25...

bors-servo added a commit that referenced this pull request May 29, 2019

Auto merge of #23381 - maharsh312:master, r=jdm
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 -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

☀️ Test successful - arm64, linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 8dc7a25 to master...

@bors-servo bors-servo merged commit 85c20db into servo:master May 29, 2019

3 of 4 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
Taskcluster (pull_request) TaskGroup: success
Details
Travis CI - Pull Request Build Passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.