speedup software blitter for 32bpp modes

git-svn-id: svn://kolibrios.org@4444 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2014-01-13 11:16:28 +00:00
parent 9820d9190e
commit 4d704be765

View File

@ -206,7 +206,13 @@ blit_32:
push edi push edi
push esi push esi
push ebx push ebx
sub esp, 72 virtual at sizeof.BLITTER
.position dd ? ; (x shl 16) + y
; ???
.extra_var1 dd ?
.local_vars_size = $
end virtual
sub esp, .local_vars_size
mov eax, [TASK_BASE] mov eax, [TASK_BASE]
mov ebx, [eax-twdw + WDATA.box.width] mov ebx, [eax-twdw + WDATA.box.width]
@ -246,9 +252,9 @@ blit_32:
mov eax, [ecx+32] mov eax, [ecx+32]
mov [esp+56], eax mov [esp+BLITTER.bitmap], eax
mov eax, [ecx+36] mov eax, [ecx+36]
mov [esp+60], eax mov [esp+BLITTER.stride], eax
mov ecx, esp mov ecx, esp
call blit_clip call blit_clip
@ -268,6 +274,11 @@ blit_32:
mov cx, bp mov cx, bp
add ecx, [esp+BLITTER.h] add ecx, [esp+BLITTER.h]
mov eax, ebx
shl eax, 16
mov ax, bp
mov [esp+.position], eax
mov edi, ebp mov edi, ebp
; imul edi, [_display.pitch] ; imul edi, [_display.pitch]
@ -300,47 +311,37 @@ blit_32:
lea edi, [edi+ebx*4] lea edi, [edi+ebx*4]
mov ebx, [CURRENT_TASK] mov ebx, [CURRENT_TASK]
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
je .core_32.software_cursor
cmp [_display.select_cursor], 0
jne .core_32.hardware_cursor
;--------------------------------------
.core_32.software_cursor:
align 4 align 4
.outer32: .outer32:
xor ecx, ecx
align 4 align 4
.inner32: .inner32:
cmp [ebp+ecx], bl cmp [ebp], bl
jne .skip jne .skip
;-------------------------------------- ;--------------------------------------
push eax mov eax, [esi]
mov eax, [esi+ecx*4]
; check for hardware cursor mov ecx, [esp+.position]
cmp [_display.select_cursor], select_cursor
je @f
cmp [_display.select_cursor], 0
jne .no_mouseunder
;--------------------------------------
align 4
@@:
push ecx
mov ecx, [esp+4]
ror ecx, 16
sub ecx, edx
rol ecx, 16
sub ecx, [esp+BLITTER.h + 8]
; check mouse area for putpixel ; check mouse area for putpixel
call [_display.check_mouse] call [_display.check_mouse]
pop ecx
;-------------------------------------- ;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB ; store to real LFB
mov [LFB_BASE+edi+ecx*4], eax mov [LFB_BASE+edi], eax
pop eax
;-------------------------------------- ;--------------------------------------
align 4 align 4
.skip: .skip:
inc ecx add esi, 4
add edi, 4
inc ebp
add [esp+.position], 1 shl 16
dec edx dec edx
jnz .inner32 jnz .inner32
@ -349,14 +350,48 @@ align 4
add ebp, [_display.width] add ebp, [_display.width]
mov edx, [esp+BLITTER.w] mov edx, [esp+BLITTER.w]
mov eax, edx
inc [esp+.position]
sub ebp, edx
shl eax, 2
sub esi, eax
sub edi, eax
shl eax, 16-2
sub [esp+.position], eax
dec [esp+BLITTER.h] dec [esp+BLITTER.h]
jnz .outer32 jnz .outer32
jmp .done
.core_32.hardware_cursor:
align 4
.hw.outer32:
xor ecx, ecx
align 4
.hw.inner32:
cmp [ebp+ecx], bl
jne .hw.skip
mov eax, [esi+ecx*4]
mov [LFB_BASE+edi+ecx*4], eax
align 4
.hw.skip:
inc ecx
dec edx
jnz .hw.inner32
add esi, [esp+BLITTER.stride]
add edi, [_display.pitch]
add ebp, [_display.width]
mov edx, [esp+BLITTER.w]
dec [esp+BLITTER.h]
jnz .hw.outer32
.done: .done:
; call [draw_pointer] ; call [draw_pointer]
; call __sys_draw_pointer ; call __sys_draw_pointer
.L57: .L57:
add esp, 72 add esp, .local_vars_size
pop ebx pop ebx
pop esi pop esi
pop edi pop edi
@ -370,7 +405,7 @@ align 4
align 4 align 4
.outer24: .outer24:
mov [esp+64], edi mov [esp+.extra_var1], edi
xor ecx, ecx xor ecx, ecx
align 4 align 4
@ -413,7 +448,7 @@ align 4
;-------------------------------------- ;--------------------------------------
align 4 align 4
.skip_1: .skip_1:
mov edi, [esp+64] mov edi, [esp+.extra_var1]
inc ecx inc ecx
dec edx dec edx
jnz .inner24 jnz .inner24