summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-05-29 10:28:37 -0400
committerKristian Høgsberg <krh@redhat.com>2008-05-29 10:30:38 -0400
commitfa9c59f86c9ccf008f0af5f5111b65df9caf6830 (patch)
tree52aa241556992949dd7822c2f268b4ff1dc4733c /src
parent6e5fe71076fe38e5236f68d4c05dcc5bcbc4dbd7 (diff)
downloadplymouth-fa9c59f86c9ccf008f0af5f5111b65df9caf6830.tar.gz
plymouth-fa9c59f86c9ccf008f0af5f5111b65df9caf6830.tar.xz
plymouth-fa9c59f86c9ccf008f0af5f5111b65df9caf6830.zip
Hook up xrgb32 flush function.
Diffstat (limited to 'src')
-rw-r--r--src/libply/ply-frame-buffer.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/libply/ply-frame-buffer.c b/src/libply/ply-frame-buffer.c
index 2d3bbc1..d6b7e1a 100644
--- a/src/libply/ply-frame-buffer.c
+++ b/src/libply/ply-frame-buffer.c
@@ -179,6 +179,27 @@ flush_generic (ply_frame_buffer_t *buffer)
free (row_buffer);
}
+static void
+flush_xrgb32 (ply_frame_buffer_t *buffer)
+{
+ unsigned long x1, y1, x2, y2, y;
+ char *dst, *src;
+
+ x1 = buffer->area_to_flush.x;
+ y1 = buffer->area_to_flush.y;
+ 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->row_stride + x1];
+
+ for (y = y1; y < y2; y++)
+ {
+ memcpy (dst, src, buffer->area_to_flush.width * 4);
+ dst += buffer->row_stride * 4;
+ src += buffer->row_stride * 4;
+ }
+}
static bool
ply_frame_buffer_query_device (ply_frame_buffer_t *buffer)
@@ -220,7 +241,13 @@ ply_frame_buffer_query_device (ply_frame_buffer_t *buffer)
buffer->row_stride = fixed_screen_info.line_length / buffer->bytes_per_pixel;
buffer->size = buffer->area.height * buffer->row_stride * buffer->bytes_per_pixel;
- buffer->flush = flush_generic;
+ if (buffer->bytes_per_pixel == 4 &&
+ buffer->red_bit_position == 16 &&
+ buffer->green_bit_position == 8 &&
+ buffer->blue_bit_position == 0)
+ buffer->flush = flush_xrgb32;
+ else
+ buffer->flush = flush_generic;
return true;
}