Clear webrender image id when resizing a canvas.

This commit is contained in:
Alan Jeffrey 2017-06-12 13:21:33 -05:00
parent 07f6e11485
commit 4e04daa9d0
5 changed files with 76 additions and 1 deletions

View file

@ -547,6 +547,10 @@ impl<'a> CanvasPaintThread<'a> {
fn recreate(&mut self, size: Size2D<i32>) {
self.drawtarget = CanvasPaintThread::create(size);
// Webrender doesn't let images change size, so we clear the webrender image key.
if let Some(image_key) = self.image_key.take() {
self.webrender_api.delete_image(image_key);
}
}
fn send_pixels(&mut self, chan: IpcSender<Option<Vec<u8>>>) {