Commit 729eaa69 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

x11drv: Copy the whole image at once if appropriate.

parent 2cba6e32
......@@ -75,8 +75,16 @@ static void convert_5x5_asis(int width, int height,
{
int y;
width *= 2;
if (srclinebytes == dstlinebytes && srclinebytes == width)
{
memcpy(dstbits, srcbits, height * width);
return;
}
for (y=0; y<height; y++) {
memcpy(dstbits, srcbits, width*2);
memcpy(dstbits, srcbits, width);
srcbits = (const char*)srcbits + srclinebytes;
dstbits = (char*)dstbits + dstlinebytes;
}
......@@ -563,8 +571,16 @@ static void convert_888_asis(int width, int height,
{
int y;
width *= 3;
if (srclinebytes == dstlinebytes && srclinebytes == width)
{
memcpy(dstbits, srcbits, height * width);
return;
}
for (y=0; y<height; y++) {
memcpy(dstbits, srcbits, width*3);
memcpy(dstbits, srcbits, width);
srcbits = (const char*)srcbits + srclinebytes;
dstbits = (char*)dstbits + dstlinebytes;
}
......@@ -953,8 +969,16 @@ static void convert_0888_asis(int width, int height,
{
int y;
width *= 4;
if (srclinebytes == dstlinebytes && srclinebytes == width)
{
memcpy(dstbits, srcbits, height * width);
return;
}
for (y=0; y<height; y++) {
memcpy(dstbits, srcbits, width*4);
memcpy(dstbits, srcbits, width);
srcbits = (const char*)srcbits + srclinebytes;
dstbits = (char*)dstbits + dstlinebytes;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment