diff options
Diffstat (limited to 'openembedded/packages/libmatchbox/files/16bppfixes.patch')
| -rw-r--r-- | openembedded/packages/libmatchbox/files/16bppfixes.patch | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/openembedded/packages/libmatchbox/files/16bppfixes.patch b/openembedded/packages/libmatchbox/files/16bppfixes.patch new file mode 100644 index 0000000000..09a0347809 --- /dev/null +++ b/openembedded/packages/libmatchbox/files/16bppfixes.patch | |||
| @@ -0,0 +1,36 @@ | |||
| 1 | Index: libmb/mbpixbuf.c | ||
| 2 | =================================================================== | ||
| 3 | --- libmatchbox/libmb.orig/mbpixbuf.c 2006-02-01 12:45:55.000000000 +0000 | ||
| 4 | +++ libmatchbox/libmb/mbpixbuf.c 2006-03-11 15:20:47.000000000 +0000 | ||
| 5 | @@ -716,7 +716,13 @@ | ||
| 6 | case 15: | ||
| 7 | return ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | ((b & 0xf8) >> 3); | ||
| 8 | case 16: | ||
| 9 | - return ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >> 3); | ||
| 10 | + switch (pb->byte_order) | ||
| 11 | + { | ||
| 12 | + case BYTE_ORD_24_RGB: | ||
| 13 | + return ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >> 3); | ||
| 14 | + case BYTE_ORD_24_BGR: | ||
| 15 | + return ((b & 0xf8) << 8) | ((g & 0xfc) << 3) | ((r & 0xf8) >> 3); | ||
| 16 | + } | ||
| 17 | case 24: | ||
| 18 | case 32: | ||
| 19 | switch (pb->byte_order) | ||
| 20 | @@ -1880,12 +1886,11 @@ | ||
| 21 | for(y=0; y<img->height; y++) | ||
| 22 | for(x=0; x<img->width; x++) | ||
| 23 | { | ||
| 24 | - /* Below is potentially dangerous. | ||
| 25 | - */ | ||
| 26 | - pixel = ( *p | (*(p+1) << 8)); | ||
| 27 | + internal_16bpp_pixel_to_rgb(p, r, g, b); | ||
| 28 | + internal_16bpp_pixel_next(p); | ||
| 29 | + a = ((img->has_alpha) ? *p++ : 0xff); | ||
| 30 | |||
| 31 | - p += ((img->has_alpha) ? 3 : 2); | ||
| 32 | - | ||
| 33 | + pixel = mb_pixbuf_get_pixel(pb, r, g, b, a); | ||
| 34 | XPutPixel(img->ximg, x, y, pixel); | ||
| 35 | } | ||
| 36 | } | ||
