summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Gupta <ashmew2@gmail.com>2016-04-19 11:17:43 (GMT)
committer Michael Drake <tlsa@netsurf-browser.org>2016-04-19 11:17:43 (GMT)
commit60d5fb4c8f1c746a789b3e6a0765089187f4cd86 (patch)
tree50bbeb156354b814122f6436a6a4b69c3aa3e9af
parent7a323cd23444d61b164300dff1b9803774f91426 (diff)
downloadlibnsfb-60d5fb4c8f1c746a789b3e6a0765089187f4cd86.tar.gz
libnsfb-60d5fb4c8f1c746a789b3e6a0765089187f4cd86.tar.bz2
Fix colour conversion to 32bpp XBGR surfaces.
-rw-r--r--src/plot/32bpp-xbgr8888.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plot/32bpp-xbgr8888.c b/src/plot/32bpp-xbgr8888.c
index 89131b4..a65719b 100644
--- a/src/plot/32bpp-xbgr8888.c
+++ b/src/plot/32bpp-xbgr8888.c
@@ -42,8 +42,9 @@ static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)
/* convert a colour value to a 32bpp pixel value ready for screen output */
static inline uint32_t colour_to_pixel(UNUSED nsfb_t *nsfb, nsfb_colour_t c)
{
- /* TODO: FIX */
- return (c << 8);
+ return ((pixel & 0xFF) << 24) |
+ ((pixel & 0xFF00) << 8) |
+ ((pixel & 0xFF0000) >> 8);
}
#else /* __BYTE_ORDER == __BIG_ENDIAN */
static inline nsfb_colour_t pixel_to_colour(UNUSED nsfb_t *nsfb, uint32_t pixel)