swap GL frames to bgra
This commit is contained in:
parent
b972478ee9
commit
571ed740dd
1 changed files with 10 additions and 0 deletions
|
@ -132,6 +132,16 @@ impl RfbServer {
|
|||
&mut self.framebuffer[dest_line_off..dest_line_off + self.width as usize];
|
||||
|
||||
dest_slice.copy_from_slice(scanlines[y as usize]);
|
||||
|
||||
// swap scanline to BGRA (compatibility hack. Should make this optional!)
|
||||
for pix in dest_slice {
|
||||
let a = ((*pix & 0xff000000) >> 24);
|
||||
let b = ((*pix & 0x00ff0000) >> 16);
|
||||
let g = ((*pix & 0x0000ff00) >> 8);
|
||||
let r = (*pix & 0x000000ff);
|
||||
|
||||
*pix = a << 24 | r << 16 | g << 8 | b;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for y in 0..self.height {
|
||||
|
|
Loading…
Reference in a new issue