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 upwebgl: Support texImage2D with a canvas as an argument #7682
Conversation
|
r? @jdm |
|
|
|
Unbitrotted :P |
|
Wow highfive really hates my rebases, it never removes the label... cc/ @jdm |
|
|
| @@ -150,6 +150,17 @@ impl LayoutHTMLCanvasElementHelpers for LayoutJS<HTMLCanvasElement> { | |||
|
|
|||
|
|
|||
| impl HTMLCanvasElement { | |||
| pub fn ipc_renderer(&self) -> Option<IpcSender<CanvasMsg>> { | |||
| if let Some(context) = self.context.get() { | |||
This comment has been minimized.
This comment has been minimized.
pcwalton
Sep 25, 2015
Contributor
Could use something like
self.context.map(|context| {
match context {
CanvasContext::Context2d(context) => context.root().r().ipc_renderer(),
CanvasContext::WebGL(context) => context.root().r().ipc_randerer(),
}
})
This comment has been minimized.
This comment has been minimized.
Prefer `Option::map` instead.
|
-S-awaiting-review +S-needs-code-changes Reviewed 5 of 5 files at r1, 4 of 4 files at r2, 2 of 2 files at r3. components/script/dom/canvasrenderingcontext2d.rs, line 962 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 8 of 9 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. components/script/dom/canvasrenderingcontext2d.rs, line 962 [r1] (raw file): Both firefox and chrome seem to return a white bitmap when the canvas has no context, but it's unintuitive something like: gl.texImage2d(..., canvas_without_context);
canvas_without_context.getContext('webgl'); // <- failsIn fact both allow it and the webgl context creation succeeds, I've done the same. Comments from the review on Reviewable.io |
|
-S-awaiting-review +S-needs-code-changes Reviewed 1 of 1 files at r4. components/script/dom/canvasrenderingcontext2d.rs, line 962 [r1] (raw file): Comments from the review on Reviewable.io |
|
Review status: 8 of 11 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. components/script/dom/canvasrenderingcontext2d.rs, line 962 [r1] (raw file): Comments from the review on Reviewable.io |
|
@bors-servo: r+ Reviewed 3 of 3 files at r5. Comments from the review on Reviewable.io |
|
|
webgl: Support texImage2D with a canvas as an argument This involved some refactoring of the 2d context code, which lead to some more test passed there. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7682) <!-- Reviewable:end -->
|
|
emilio commentedSep 19, 2015
This involved some refactoring of the 2d context code, which lead to some more test passed there.