mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
Fix 16bpp patch which doesn't use stride consistently - see #4221
This commit is contained in:
parent
6c016f6daf
commit
246e376339
@ -1,7 +1,6 @@
|
||||
diff -Naur plymouth-lite-0.6.0/ply-frame-buffer.c plymouth-lite-0.6.0.patch/ply-frame-buffer.c
|
||||
--- plymouth-lite-0.6.0/ply-frame-buffer.c 2012-05-02 22:29:21.505665089 +0200
|
||||
+++ plymouth-lite-0.6.0.patch/ply-frame-buffer.c 2012-05-04 01:40:24.000000000 +0200
|
||||
@@ -149,6 +149,58 @@
|
||||
--- plymouth-lite-0.6.0/ply-frame-buffer.c 2015-07-02 01:04:37.625076373 +0100
|
||||
+++ plymouth-lite-0.6.0.patch/ply-frame-buffer.c 2015-07-02 01:04:42.973076293 +0100
|
||||
@@ -184,6 +184,58 @@
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,11 +15,11 @@ diff -Naur plymouth-lite-0.6.0/ply-frame-buffer.c plymouth-lite-0.6.0.patch/ply-
|
||||
+ x2 = x1 + buffer->area_to_flush.width;
|
||||
+ y2 = y1 + buffer->area_to_flush.height;
|
||||
+
|
||||
+ dst = &buffer->map_address[(y1 * buffer->row_stride + x1) * 4];
|
||||
+ src = (char *) &buffer->shadow_buffer[y1 * buffer->area.width + x1];
|
||||
+
|
||||
+ for (y = y1; y < y2; y++)
|
||||
+ {
|
||||
+ dst = &buffer->map_address[(y * buffer->row_stride + x1) * 4];
|
||||
+ src = (char *) &buffer->shadow_buffer[y * buffer->area.width + x1];
|
||||
+
|
||||
+ for (x = x1; x < x2; x++)
|
||||
+ {
|
||||
+ dst[0] = src[2];
|
||||
@ -44,11 +43,11 @@ diff -Naur plymouth-lite-0.6.0/ply-frame-buffer.c plymouth-lite-0.6.0.patch/ply-
|
||||
+ x2 = x1 + buffer->area_to_flush.width;
|
||||
+ y2 = y1 + buffer->area_to_flush.height;
|
||||
+
|
||||
+ dst = (unsigned short *)&buffer->map_address[(y1 * buffer->row_stride + x1) * 2];
|
||||
+ src = (unsigned char *) &buffer->shadow_buffer[y1 * buffer->area.width + x1];
|
||||
+
|
||||
+ for (y = y1; y < y2; y++)
|
||||
+ {
|
||||
+ dst = (unsigned short *)&buffer->map_address[(y * buffer->row_stride + x1) * 2];
|
||||
+ src = (unsigned char *) &buffer->shadow_buffer[y * buffer->area.width + x1];
|
||||
+
|
||||
+ for (x = x1; x < x2; x++)
|
||||
+ {
|
||||
+ *dst++ = (src[0]>>3) << 0 | (src[1]>>2) << 5 | (src[2]>>3) << 11;
|
||||
@ -60,29 +59,19 @@ diff -Naur plymouth-lite-0.6.0/ply-frame-buffer.c plymouth-lite-0.6.0.patch/ply-
|
||||
static const char const *p_visual(int visual)
|
||||
{
|
||||
static const char const *visuals[] =
|
||||
@@ -260,11 +312,26 @@
|
||||
buffer->dither_green = 0;
|
||||
buffer->dither_blue = 0;
|
||||
|
||||
+printf("%d,%d,%d,%d,%d,%d,%d\n", buffer->bytes_per_pixel,
|
||||
+ buffer->red_bit_position, buffer->bits_for_red,
|
||||
+ buffer->green_bit_position, buffer->bits_for_green,
|
||||
+ buffer->blue_bit_position, buffer->bits_for_blue);
|
||||
+
|
||||
if (buffer->bytes_per_pixel == 4 &&
|
||||
buffer->red_bit_position == 16 && buffer->bits_for_red == 8 &&
|
||||
@@ -300,6 +352,16 @@
|
||||
buffer->green_bit_position == 8 && buffer->bits_for_green == 8 &&
|
||||
buffer->blue_bit_position == 0 && buffer->bits_for_blue == 8)
|
||||
buffer->flush = flush_xrgb32;
|
||||
+ else if (buffer->bytes_per_pixel == 4 &&
|
||||
+ buffer->red_bit_position == 0 && buffer->bits_for_red == 8 &&
|
||||
+ buffer->green_bit_position == 8 && buffer->bits_for_green == 8 &&
|
||||
+ buffer->blue_bit_position == 16 && buffer->bits_for_blue == 8)
|
||||
+ buffer->red_bit_position == 0 && buffer->bits_for_red == 8 &&
|
||||
+ buffer->green_bit_position == 8 && buffer->bits_for_green == 8 &&
|
||||
+ buffer->blue_bit_position == 16 && buffer->bits_for_blue == 8)
|
||||
+ buffer->flush = flush_xbgr32;
|
||||
+ else if (buffer->bytes_per_pixel == 2 &&
|
||||
+ buffer->red_bit_position == 11 && buffer->bits_for_red == 5 &&
|
||||
+ buffer->green_bit_position == 5 && buffer->bits_for_green == 6 &&
|
||||
+ buffer->blue_bit_position == 0 && buffer->bits_for_blue == 5)
|
||||
+ buffer->red_bit_position == 11 && buffer->bits_for_red == 5 &&
|
||||
+ buffer->green_bit_position == 5 && buffer->bits_for_green == 6 &&
|
||||
+ buffer->blue_bit_position == 0 && buffer->bits_for_blue == 5)
|
||||
+ buffer->flush = flush_rgb16;
|
||||
else
|
||||
buffer->flush = flush_generic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user