From: Ray Strode Date: Thu, 29 May 2008 18:34:35 +0000 (-0400) Subject: Add an optimization for full width fills on some hardware X-Git-Tag: 0.1.0~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3493c2919fb84c201303459afc6c6bcdf855185b;p=thirdparty%2Fplymouth.git Add an optimization for full width fills on some hardware If we know the rowstride is the same width as the frame buffer then we can memcpy multiple rows at one time. --- diff --git a/src/libply/ply-frame-buffer.c b/src/libply/ply-frame-buffer.c index 288f7e76..dbf6f111 100644 --- a/src/libply/ply-frame-buffer.c +++ b/src/libply/ply-frame-buffer.c @@ -188,6 +188,12 @@ flush_xrgb32 (ply_frame_buffer_t *buffer) dst = &buffer->map_address[(y1 * buffer->row_stride + x1) * 4]; src = (char *) &buffer->shadow_buffer[y1 * buffer->row_stride + x1]; + if (buffer->area_to_flush.width == buffer->row_stride) + { + memcpy (dst, src, buffer->area_to_flush.width * buffer->area_to_flush.height * 4); + return; + } + for (y = y1; y < y2; y++) { memcpy (dst, src, buffer->area_to_flush.width * 4);