mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 07:38:22 +02:00
[cairo-xlib] Add recently-added byteswap macros (#16128)
This commit is contained in:
parent
0bf941c9b2
commit
f3a3a0594d
1 changed files with 2 additions and 6 deletions
|
|
@ -334,8 +334,7 @@ _swap_ximage_2bytes (XImage *ximage)
|
|||
for (j = ximage->height; j; j--) {
|
||||
uint16_t *p = (uint16_t *)line;
|
||||
for (i = ximage->width; i; i--) {
|
||||
*p = (((*p & 0x00ff) << 8) |
|
||||
((*p) >> 8));
|
||||
*p = bswap_16 (*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
|
|
@ -352,10 +351,7 @@ _swap_ximage_4bytes (XImage *ximage)
|
|||
for (j = ximage->height; j; j--) {
|
||||
uint32_t *p = (uint32_t *)line;
|
||||
for (i = ximage->width; i; i--) {
|
||||
*p = (((*p & 0x000000ff) << 24) |
|
||||
((*p & 0x0000ff00) << 8) |
|
||||
((*p & 0x00ff0000) >> 8) |
|
||||
((*p) >> 24));
|
||||
*p = bswap_32 (*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue