From cff501187cad4cc7d644d4f05f940b2fbb59ab33 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 3 May 2013 14:07:30 +0200 Subject: [PATCH] * grub-core/video/fb/fbblit.c (grub_video_fbblit_blend_BGR888_RGBA8888): Fix order bug. (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. --- ChangeLog | 6 ++++++ grub-core/video/fb/fbblit.c | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e8884a8e..c26b110f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-05-03 Vladimir Serbinenko + + * grub-core/video/fb/fbblit.c (grub_video_fbblit_blend_BGR888_RGBA8888): + Fix order bug. + (grub_video_fbblit_blend_RGB888_RGBA8888): Likewise. + 2013-05-03 Vladimir Serbinenko * include/grub/gui.h (grub_gfxmenu_timeout_unregister): Free cb diff --git a/grub-core/video/fb/fbblit.c b/grub-core/video/fb/fbblit.c index 13e2926bf..541a0ceaf 100644 --- a/grub-core/video/fb/fbblit.c +++ b/grub-core/video/fb/fbblit.c @@ -986,11 +986,18 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, /* General pixel color blending. */ color = *dstptr; +#ifndef GRUB_CPU_WORDS_BIGENDIAN db = dstptr[0]; - db = (db * (255 - a) + sb * a) / 255; dg = dstptr[1]; - dg = (dg * (255 - a) + sg * a) / 255; dr = dstptr[2]; +#else + dr = dstptr[0]; + dg = dstptr[1]; + db = dstptr[2]; +#endif + + db = (db * (255 - a) + sb * a) / 255; + dg = (dg * (255 - a) + sg * a) / 255; dr = (dr * (255 - a) + sr * a) / 255; } @@ -1145,13 +1152,13 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, } #ifndef GRUB_CPU_WORDS_BIGENDIAN - db = dstptr[0]; - dg = dstptr[1]; - dr = dstptr[2]; -#else dr = dstptr[0]; dg = dstptr[1]; db = dstptr[2]; +#else + db = dstptr[0]; + dg = dstptr[1]; + dr = dstptr[2]; #endif dr = (dr * (255 - a) + sr * a) / 255;