Handle zero-sized source surfaces properly, and upgrade ipc-channel to

incorporate the fix for zero-sized shmem on Mac.

Depends on servo/rust-azure#201 and pcwalton/ipc-channel#10.

Closes #7422.
This commit is contained in:
Patrick Walton 2015-09-30 14:51:52 -07:00
parent a7743052ca
commit 24fdc8a3c7
6 changed files with 95 additions and 53 deletions

View file

@ -196,10 +196,14 @@ impl<'a> PaintContext<'a> {
self.draw_target.make_current();
let draw_target_ref = &self.draw_target;
let azure_surface = draw_target_ref.create_source_surface_from_data(&image.bytes,
size,
stride as i32,
source_format);
let azure_surface = match draw_target_ref.create_source_surface_from_data(&image.bytes,
size,
stride as i32,
source_format) {
Some(azure_surface) => azure_surface,
None => return,
};
let source_rect = Rect::new(Point2D::new(0.0, 0.0),
Size2D::new(image.width as AzFloat, image.height as AzFloat));
let dest_rect = bounds.to_nearest_azure_rect(scale);