projects
/
platform
/
upstream
/
gummiboot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cc78753
)
graphics: simplify 16bpp calculation
author
Tom Gundersen
<teg@jklm.no>
Tue, 17 Dec 2013 15:09:54 +0000
(16:09 +0100)
committer
Tom Gundersen
<teg@jklm.no>
Tue, 17 Dec 2013 15:09:54 +0000
(16:09 +0100)
src/efi/graphics.c
patch
|
blob
|
history
diff --git
a/src/efi/graphics.c
b/src/efi/graphics.c
index
9cb6cb4
..
23b5d7d
100644
(file)
--- a/
src/efi/graphics.c
+++ b/
src/efi/graphics.c
@@
-252,9
+252,11
@@
EFI_STATUS bmp_to_blt(UINT8 *bmp, UINTN size,
break;
case 16: {
- out->Red = ((in[1] >> 2) & 0x1f) << 3;
- out->Green = (((in[1] << 3) & 0x1f) + (in[0] >> 5)) << 3;
- out->Blue = ((in[0] & 0x1f)) << 3;
+ UINT16 i = *(UINT16 *) in;
+
+ out->Red = (i & 0x7c00) >> 7;
+ out->Green = (i & 0x3e0) >> 2;
+ out->Blue = (i & 0x1f) << 3;
in += 1;
break;
}