Add WebGLContextAttributes support

This commit also:
* Allows to return non-rootable dictionaries from
Codegen.
* Merges the two context types in an enum type.
This commit is contained in:
ecoal95 2015-05-25 14:47:23 +02:00
parent b1a773a15b
commit b3ac346749
16 changed files with 255 additions and 80 deletions

View file

@ -214,7 +214,11 @@ impl CanvasRenderingContext2D {
let msg = if self.canvas.root().r() == canvas {
CanvasMsg::Canvas2d(Canvas2dMsg::DrawImageSelf(image_size, dest_rect, source_rect, smoothing_enabled))
} else { // Source and target canvases are different
let context = canvas.get_2d_context().root();
let context = match canvas.get_or_init_2d_context() {
Some(context) => context.root(),
None => return Err(InvalidState),
};
let renderer = context.r().get_renderer();
let (sender, receiver) = channel::<Vec<u8>>();
// Reads pixels from source image