If we know the rowstride is the same width as the frame buffer
then we can memcpy multiple rows at one time.
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);