kernel: blitter - minor optimizations

git-svn-id: svn://kolibrios.org@5349 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2015-01-05 15:12:40 +00:00
parent a0650ddd79
commit 7c2e2980d7

View File

@ -37,7 +37,7 @@ block_clip:
;esi= clip RECT ptr ;esi= clip RECT ptr
;edi= RECT ptr ;edi= RECT ptr
;return code: ;return code:
;eax= 0 - draw, 1 - don't draw ;CF= 0 - draw, 1 - don't draw
push ebx push ebx
@ -53,18 +53,15 @@ block_clip:
jl .fail jl .fail
cmp eax, ecx ;left >= clip.left cmp eax, ecx ;left >= clip.left
jae @F jge @F
mov eax, ecx mov [edi+RECT.left], ecx
@@: @@:
mov [edi+RECT.left], eax
cmp ebx, edx ;right <= clip.right cmp ebx, edx ;right <= clip.right
jle @f jle @f
mov ebx, edx
@@:
mov [edi+RECT.right], ebx
mov [edi+RECT.right], edx
@@:
mov eax, [edi+RECT.top] mov eax, [edi+RECT.top]
mov ebx, [edi+RECT.bottom] mov ebx, [edi+RECT.bottom]
mov ecx, [esi+RECT.top] ;clip.top mov ecx, [esi+RECT.top] ;clip.top
@ -77,29 +74,30 @@ block_clip:
jl .fail jl .fail
cmp eax, ecx ;top >= clip.top cmp eax, ecx ;top >= clip.top
jae @F jge @F
mov eax, ecx mov [edi+RECT.top], ecx
@@: @@:
mov [edi+RECT.top], eax
cmp ebx, edx ;bottom <= clip.bottom cmp ebx, edx ;bottom <= clip.bottom
jle @f jle @f
mov ebx, edx
mov [edi+RECT.bottom], edx
@@: @@:
mov [edi+RECT.bottom], ebx
pop ebx pop ebx
xor eax, eax clc
ret ret
.fail: .fail:
pop ebx pop ebx
mov eax, 1 stc
ret ret
align 4 align 4
blit_clip: blit_clip:
;return code:
;CF= 0 - draw, 1 - don't draw
.sx0 equ 8 .sx0 equ 8
.sy0 equ 12 .sy0 equ 12
.sx1 equ 16 .sx1 equ 16
@ -130,9 +128,7 @@ blit_clip:
lea esi, [ebx+BLITTER.sc] lea esi, [ebx+BLITTER.sc]
call block_clip call block_clip
test eax, eax jc .done
mov esi, 1
jnz .done
mov edi, [esp+.sx0] mov edi, [esp+.sx0]
mov edx, [ebx+BLITTER.dst_x] mov edx, [ebx+BLITTER.dst_x]
@ -157,9 +153,7 @@ blit_clip:
lea edi, [esp+.dx0] lea edi, [esp+.dx0]
lea esi, [ebx+BLITTER.dc] lea esi, [ebx+BLITTER.dc]
call block_clip call block_clip
test eax, eax jc .done
mov esi, 1
jnz .done
mov edx, [esp+.dx0] mov edx, [esp+.dx0]
mov eax, [esp+.dx1] mov eax, [esp+.dx1]
@ -182,9 +176,8 @@ blit_clip:
mov [ebx+BLITTER.src_y], ecx mov [ebx+BLITTER.src_y], ecx
mov [ebx+BLITTER.dst_x], edx mov [ebx+BLITTER.dst_x], edx
mov [ebx+BLITTER.dst_y], eax mov [ebx+BLITTER.dst_y], eax
xor esi, esi clc
.done: .done:
mov eax, esi
add esp, 40 add esp, 40
pop ebx pop ebx
pop esi pop esi
@ -261,8 +254,7 @@ end virtual
mov ecx, esp mov ecx, esp
call blit_clip call blit_clip
test eax, eax jc .L57
jne .L57
mov eax, [TASK_BASE] mov eax, [TASK_BASE]