]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add an optimization for full width fills on some hardware
authorRay Strode <rstrode@redhat.com>
Thu, 29 May 2008 18:34:35 +0000 (14:34 -0400)
committerRay Strode <rstrode@redhat.com>
Thu, 29 May 2008 18:34:35 +0000 (14:34 -0400)
If we know the rowstride is the same width as the frame buffer
then we can memcpy multiple rows at one time.

src/libply/ply-frame-buffer.c

index 288f7e7668eaa50a2d82e7589430c95adeb82590..dbf6f1113460d125c0d1dd630d6337370483f755 100644 (file)
@@ -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);