Use a byte channel to retrieve pixels of 2D canvas

This commit is contained in:
Anthony Ramine 2018-09-13 16:21:57 +02:00
parent b5c469d52e
commit 2f2331f149
3 changed files with 10 additions and 10 deletions

View file

@ -11,7 +11,7 @@ use azure::azure_hl::SurfacePattern;
use canvas_traits::canvas::*;
use cssparser::RGBA;
use euclid::{Transform2D, Point2D, Vector2D, Rect, Size2D};
use ipc_channel::ipc::IpcSender;
use ipc_channel::ipc::{IpcBytesSender, IpcSender};
use num_traits::ToPrimitive;
use serde_bytes::ByteBuf;
use std::mem;
@ -456,9 +456,9 @@ impl<'a> CanvasData<'a> {
&self,
dest_rect: Rect<i32>,
canvas_size: Size2D<f64>,
chan: IpcSender<ByteBuf>,
sender: IpcBytesSender,
) {
chan.send(self.read_pixels(dest_rect, canvas_size).into()).unwrap();
sender.send(&self.read_pixels(dest_rect, canvas_size)).unwrap();
}
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata