2009-08-02 15:49:17 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: Win32 subsystem
|
|
|
|
* LICENSE: See COPYING in the top level directory
|
2015-11-10 17:41:55 +00:00
|
|
|
* FILE: win32ss/gdi/dib/i386/dib32bpp_colorfill.s
|
2009-08-02 15:49:17 +00:00
|
|
|
* PURPOSE: ASM optimised 32bpp ColorFill
|
|
|
|
* PROGRAMMERS: Magnus Olsen
|
2009-08-04 20:37:10 +00:00
|
|
|
* Timo Kreuzer (timo.kreuzer@reactos.org)
|
2006-08-26 23:26:39 +00:00
|
|
|
*/
|
2009-08-02 15:49:17 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
#include <asm.inc>
|
2006-08-26 23:26:39 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
.code
|
2009-08-02 22:31:29 +00:00
|
|
|
/*
|
|
|
|
* BOOLEAN
|
|
|
|
* _cdecl
|
|
|
|
* DIB_32BPP_ColorFill(SURFOBJ* pso, RECTL* prcl, ULONG iColor);
|
|
|
|
*/
|
2009-08-02 15:49:17 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
PUBLIC _DIB_32BPP_ColorFill
|
2009-08-02 22:31:29 +00:00
|
|
|
_DIB_32BPP_ColorFill:
|
|
|
|
push ebp
|
|
|
|
mov ebp, esp
|
|
|
|
push ebx
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
sub esp, 4 /* Space for lDelta */
|
2009-08-02 15:49:17 +00:00
|
|
|
|
2009-08-02 22:31:29 +00:00
|
|
|
mov edx, [ebp+12] /* edx = prcl */
|
|
|
|
mov ecx, [ebp+8] /* ecx = pso */
|
2009-08-02 15:49:17 +00:00
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
mov ebx, [ecx+36] /* ebx = pso->lDelta; */
|
2009-08-02 22:31:29 +00:00
|
|
|
mov [esp], ebx /* lDelta = pso->lDelta; */
|
|
|
|
mov edi, [edx+4] /* edi = prcl->top; */
|
|
|
|
mov eax, edi /* eax = prcl->top; */
|
|
|
|
imul eax, ebx /* eax = prcl->top * pso->lDelta; */
|
2010-11-27 22:12:15 +00:00
|
|
|
add eax, [ecx+32] /* eax += pso->pvScan0; */
|
2009-08-02 22:31:29 +00:00
|
|
|
mov ebx, [edx] /* ebx = prcl->left; */
|
|
|
|
lea esi, [eax+ebx*4] /* esi = pvLine0 = eax + 4 * prcl->left; */
|
|
|
|
|
|
|
|
mov ebx, [edx+8] /* ebx = prcl->right; */
|
|
|
|
sub ebx, [edx] /* ebx = prcl->right - prcl->left; */
|
2011-10-14 18:03:07 +00:00
|
|
|
jle .end /* if (ebx <= 0) goto end; */
|
2009-08-02 22:31:29 +00:00
|
|
|
|
|
|
|
mov edx, [edx+12] /* edx = prcl->bottom; */
|
|
|
|
sub edx, edi /* edx -= prcl->top; */
|
2011-10-14 18:03:07 +00:00
|
|
|
jle .end /* if (eax <= 0) goto end; */
|
2009-08-02 22:31:29 +00:00
|
|
|
|
|
|
|
mov eax, [ebp+16] /* eax = iColor; */
|
|
|
|
cld
|
|
|
|
|
|
|
|
for_loop: /* do { */
|
|
|
|
mov edi, esi /* edi = pvLine0; */
|
|
|
|
mov ecx, ebx /* ecx = cx; */
|
|
|
|
rep stosd /* memset(pvLine0, iColor, cx); */
|
|
|
|
add esi, [esp] /* pvLine0 += lDelta; */
|
|
|
|
dec edx /* cy--; */
|
|
|
|
jnz for_loop /* } while (cy > 0); */
|
|
|
|
|
2010-11-27 22:12:15 +00:00
|
|
|
.end:
|
2009-08-02 22:31:29 +00:00
|
|
|
mov eax, 1
|
|
|
|
add esp, 4
|
|
|
|
pop edi
|
|
|
|
pop esi
|
|
|
|
pop ebx
|
|
|
|
pop ebp
|
|
|
|
ret
|
2010-11-27 22:12:15 +00:00
|
|
|
|
|
|
|
END
|