mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use a byte channel to retrieve pixels of 2D canvas
This commit is contained in:
parent
b5c469d52e
commit
2f2331f149
3 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue