forked from KolibriOS/kolibrios
'buf2d.obj' functions 'buf_rect_by_size' and 'buf_filled_rect_by_size' work faster (optimize function 'buf_line_h')
git-svn-id: svn://kolibrios.org@2177 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1068,18 +1068,43 @@ proc buf_line_h, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword
|
||||
cmp buf2d_bits,24
|
||||
jne .end24
|
||||
|
||||
mov ebx,dword[coord_x0]
|
||||
mov ecx,dword[coord_y0]
|
||||
mov edx,dword[color]
|
||||
bt ecx,31
|
||||
jc .end24 ;<3B> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> y0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭠<E2A5AB>
|
||||
cmp ecx,buf2d_h
|
||||
jge .end24 ;<3B> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> y0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mov ebx,dword[coord_x0]
|
||||
mov esi,dword[coord_x1]
|
||||
cmp ebx,esi
|
||||
jle @f
|
||||
xchg ebx,esi ;<3B> x0 > x1 <20><> <20><><EFBFBD>塞 <20><><EFBFBD>⠬<EFBFBD> x0 <20> x1
|
||||
@@:
|
||||
cmp esi,buf2d_w
|
||||
jl @f
|
||||
mov esi,buf2d_w
|
||||
;dec esi
|
||||
@@:
|
||||
|
||||
;<3B> eax <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <20><>砫<EFBFBD> 1-<2D> <20><>窨 <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mov eax,buf2d_w ;size x
|
||||
imul eax,ecx ;size_x*y
|
||||
add eax,ebx ;size_x*y+x
|
||||
lea eax,[eax+eax*2] ;(size_x*y+x)*3
|
||||
add eax,buf2d_data ;ptr+(size_x*y+x)*3
|
||||
|
||||
mov edx,dword[color]
|
||||
@@: ;横<> <20><> <20><><EFBFBD> x <20><> x0 <20><> x1
|
||||
cmp ebx,esi
|
||||
jge @f
|
||||
call draw_pixel
|
||||
bt ebx,31
|
||||
jc .otr_x
|
||||
mov word[eax],dx ;copy pixel color
|
||||
ror edx,16
|
||||
mov byte[eax+2],dl
|
||||
ror edx,16
|
||||
.otr_x:
|
||||
add eax,3
|
||||
inc ebx
|
||||
jmp @b
|
||||
@@:
|
||||
|
Reference in New Issue
Block a user