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 upInitial Steps OffscreenCanvas API #22379
Conversation
highfive
commented
Dec 7, 2018
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon. |
highfive
commented
Dec 7, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Dec 7, 2018
| } | ||
| //let global = window_from_node(self); | ||
| let size = self.get_size(); | ||
| let context = unsafe {OffscreenCanvasRenderingContext2D::new(&GlobalScope::from_context(cx), self, size)}; |
This comment has been minimized.
This comment has been minimized.
jdm
Dec 8, 2018
Member
This can use let context = OffscreenCanvasRenderingContext2D::new(self.global(), self, size); instead.
This comment has been minimized.
This comment has been minimized.
maharsh312
Dec 15, 2018
Author
Contributor
@jdm This statement give error as offscreencanvas does not have it's own global defined.
Error:"error[E0599]: no method named global found for type &dom::offscreencanvas::OffscreenCanvas in the current scope
"
This comment has been minimized.
This comment has been minimized.
| // ***************** For Mixin CanvasState *********************************** | ||
| // https://html.spec.whatwg.org/multipage/#dom-context-2d-save | ||
| fn Save(&self) { | ||
| self.saved_states |
This comment has been minimized.
This comment has been minimized.
jdm
Dec 8, 2018
Member
This doesn't compile, right? Rather than duplicating all of the canvas implementation code, I wanted to move the relevant implementation of CanvasRenderingContext2D methods to a structure that can be shared by both CanvasRenderingContext2D and OffscreenCanvasRenderingContext2D. For example:
struct CanvasState {
saved_states: ...,
...
}
impl CanvasState {
fn save(&self) {
....
}
}
impl OffscreenCanvasRenderingContext2DMethods for OffscreenCanvasRenderingContext2D {
fn Save(&self) {
self.canvas_state.save()
}
}
impl CanvasRenderingContext2DMethods for CanvasRenderingContext2D {
fn Save(&self) {
self.canvas_state.save()
}
}|
|
|
Closed the pull resquest as I am updating my GitHub fork. |
maharsh312 commentedDec 7, 2018
•
edited by SimonSapin
@Chiaggs @PrayaniSingh0106
Initial Steps for OffscreenCanvas API
r? @jdm
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is