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.
This commit is contained in:
Ray Strode 2008-05-29 14:34:35 -04:00
parent 697dc98ebb
commit 3493c2919f

View 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);