mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Merge byte swap and unmultiplying loops in ctx.getImageData()
This commit is contained in:
parent
983a914da3
commit
b5c469d52e
2 changed files with 6 additions and 10 deletions
|
@ -458,11 +458,7 @@ impl<'a> CanvasData<'a> {
|
|||
canvas_size: Size2D<f64>,
|
||||
chan: IpcSender<ByteBuf>,
|
||||
) {
|
||||
let mut dest_data = self.read_pixels(dest_rect, canvas_size);
|
||||
|
||||
// bgra -> rgba
|
||||
byte_swap(&mut dest_data);
|
||||
chan.send(dest_data.into()).unwrap();
|
||||
chan.send(self.read_pixels(dest_rect, canvas_size).into()).unwrap();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-context-2d-putimagedata
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue