Made 8 bpp to 24 bit depth conversion in X11DRV_DIB_SetImageBits_8

faster by using inline asm.
This commit is contained in:
Vedran Rodic 2001-03-05 19:59:29 +00:00 committed by Alexandre Julliard
parent 566a52ad8c
commit 817b134e05
1 changed files with 29 additions and 0 deletions

View File

@ -977,6 +977,35 @@ static void X11DRV_DIB_SetImageBits_8( int lines, const BYTE *srcbits,
return;
}
break;
#endif
case 24:
#if defined(__i386__) && defined(__GNUC__)
if (lines && (dstwidth!=left) && (bmpImage->bits_per_pixel == 32))
{
for (h = lines ; h--; ) {
int _cl1,_cl2; /* temp outputs for asm below */
/* Borrowed from DirectDraw */
__asm__ __volatile__(
"xor %%eax,%%eax\n"
"cld\n"
"1:\n"
" lodsb\n"
" movl (%%edx,%%eax,4),%%eax\n"
" stosl\n"
" xor %%eax,%%eax\n"
" loop 1b\n"
:"=S" (bits), "=D" (_cl1), "=c" (_cl2)
:"S" (bits),
"D" (bmpImage->data+h*bmpImage->bytes_per_line+left*4),
"c" (dstwidth-left),
"d" (colors)
:"eax", "cc", "memory"
);
bits = (srcbits += linebytes) + left;
}
return;
}
break;
#endif
default:
break; /* use slow generic case below */