Video draw and VESA - some speedup.

git-svn-id: svn://kolibrios.org@2453 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-03-12 18:26:37 +00:00
parent c039e0039c
commit 54ec7e5e23
9 changed files with 313 additions and 137 deletions

View File

@ -164,17 +164,17 @@ dll_cur_addr dd MIN_DEFAULT_DLL_ADDR
; mike.dld {
db 0
dd servetable-0x10000
align 4
draw_line dd __sys_draw_line
draw_pointer dd __sys_draw_pointer
;db 0
;dd servetable-0x10000
;align 4
;draw_line dd __sys_draw_line
;draw_pointer dd __sys_draw_pointer
;//mike.dld, 2006-08-02 [
;drawbar dd __sys_drawbar
;drawbar dd __sys_drawbar.forced
drawbar dd vesa20_drawbar
;;drawbar dd __sys_drawbar
;;drawbar dd __sys_drawbar.forced
;drawbar dd vesa20_drawbar
;//mike.dld, 2006-08-02 ]
putpixel dd __sys_putpixel
;putpixel dd __sys_putpixel
; } mike.dld

View File

@ -133,7 +133,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
call button._.button_dececx
push edi
xor edi, edi
call [draw_line]
; call [draw_line]
call __sys_draw_line
pop edi
add ebx, 0x00010001
dec edx
@ -164,7 +165,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
xor edi, edi
mov ecx, esi
call button._.incecx
call [draw_line]
; call [draw_line]
call __sys_draw_line
; bottom border
movzx edx, word[esp + 4 + 0]
@ -173,7 +175,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
add ebx, edx
mov ecx, esi
call button._.dececx
call [draw_line]
; call [draw_line]
call __sys_draw_line
; left border
pop ebx
@ -188,7 +191,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
pop edx
mov ecx, esi
call button._.incecx
call [draw_line]
; call [draw_line]
call __sys_draw_line
; right border
mov dx, [esp + 4]
@ -198,7 +202,8 @@ syscall_button: ;///// system function 8 //////////////////////////////////////
add ebx, 0x00010000
mov ecx, esi
call button._.dececx
call [draw_line]
; call [draw_line]
call __sys_draw_line
pop ecx ebx

View File

@ -77,7 +77,8 @@ align 4
jz .pixloop1end
jnc .nopix
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
jmp .pixloop1cont
;--------------------------------------
align 4
@ -87,7 +88,8 @@ align 4
push ecx
mov ecx, [esp+4+20h+20h]
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
pop ecx
;--------------------------------------
align 4
@ -123,7 +125,8 @@ align 4
shr dl, 1
jnc .nopix2
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
jmp .pixloop2cont
;--------------------------------------
align 4
@ -133,7 +136,8 @@ align 4
push ecx
mov ecx, [esp+12+20h+20h]
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
pop ecx
;--------------------------------------
align 4

View File

@ -401,7 +401,8 @@ _dw3l:
inc ecx
mov edx, [_skinh]
mov edi, [common_colours+4]; standard grab color
call [drawbar]
; call [drawbar]
call vesa20_drawbar
jmp draw_clientbar
;--------------------------------------
align 4
@ -428,7 +429,8 @@ draw_clientbar:
mov edi, [esi+WDATA.cl_workarea]
test edi, 0x40000000
jnz _noinside2
call [drawbar]
; call [drawbar]
call vesa20_drawbar
;--------------------------------------
align 4
_noinside2:

View File

@ -60,7 +60,8 @@ align 4
; type II - only reserve area, no draw
; call sys_window_mouse
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
jmp .exit
;--------------------------------------
align 4
@ -681,14 +682,16 @@ align 4
test ecx, 1 shl 25
jnz @f
sub ecx, 1 shl 25
call [draw_line]
; call [draw_line]
call __sys_draw_line
;--------------------------------------
align 4
@@:
; draw bottom border
mov ebx, [esp - 2]
pop bx
call [draw_line]
; call [draw_line]
call __sys_draw_line
pop ebx
add ebx, 1 * 65536 - 1
@ -698,12 +701,14 @@ align 4
push eax
rol eax, 16
pop ax
call [draw_line]
; call [draw_line]
call __sys_draw_line
; draw right border
mov eax, [esp - 2]
pop ax
call [draw_line]
; call [draw_line]
call __sys_draw_line
pop edi ecx ebx eax
ret
@ -760,7 +765,8 @@ align 4
align 4
@@:
and ecx, 0x00ffffff
call [draw_line]
; call [draw_line]
call __sys_draw_line
inc edx
cmp edx, [esp]
jb .next_line
@ -813,7 +819,8 @@ drawwindow_I: ;////////////////////////////////////////////////////////////////
mov ebx, 21
mov ecx, [esi + WDATA.box.width]
mov edx, [esi + WDATA.box.height]
call [drawbar]
; call [drawbar]
call vesa20_drawbar
;--------------------------------------
align 4
.exit:
@ -871,7 +878,8 @@ align 4
@@:
mov [esi + WDATA.cl_titlebar], ecx
and ecx, 0x00ffffff
call [draw_line]
; call [draw_line]
call __sys_draw_line
inc edx
cmp edx, [esp]
jb .next_line
@ -951,7 +959,8 @@ align 4
mov edx, [esi + WDATA.box.height]
sub ecx, 4
sub edx, 4
call [drawbar]
; call [drawbar]
call vesa20_drawbar
;--------------------------------------
align 4
.exit:
@ -2314,7 +2323,8 @@ align 4
;--------------------------------------
align 4
.exit:
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
ret
;------------------------------------------------------------------------------
align 4

View File

@ -84,7 +84,8 @@ mres:
pop eax
mov edi, 1 ; force
or ecx, 0x04000000 ; don't save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
pop edx
pop ecx
inc ecx
@ -201,7 +202,8 @@ drm:
mov ecx, [MOUSE_COLOR_MEM]
mov edi, 1 ; force
or ecx, 0x04000000 ; don't save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
pop ecx
mov ebx, [esp+0] ; pure y coord again
mov eax, [esp+4] ; and x

View File

@ -1042,7 +1042,8 @@ boot_log:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 32
osloop:
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
call window_check_events
call mouse_check_events
call checkmisc
@ -1974,7 +1975,8 @@ restore_default_cursor_before_killing:
mov [current_cursor], esi
@@:
mov [redrawmouse_unconditional], 1
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
ret
;------------------------------------------------------------------------------
iglobal
@ -3745,13 +3747,15 @@ dbrv20:
cmp [BgrDrawMode], dword 1
jne bgrstr
call vesa20_drawbackground_tiled
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
ret
;--------------------------------------
align 4
bgrstr:
call vesa20_drawbackground_stretch
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
ret
;-----------------------------------------------------------------------------
align 4
@ -4523,7 +4527,8 @@ syscall_setpixel: ; SetPixel
add ebx, [edi+APPDATA.wnd_clientbox.top]
xor edi, edi ; no force
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
jmp [putpixel]
; jmp [putpixel]
jmp __sys_putpixel
align 4
@ -4580,7 +4585,8 @@ syscall_drawrect: ; DrawRect
add ebx, [esi + APPDATA.wnd_clientbox.top]
add ecx, eax
add edx, ebx
jmp [drawbar]
; jmp [drawbar]
jmp vesa20_drawbar
.drectr:
ret
@ -4751,8 +4757,8 @@ syscall_drawline: ; DrawLine
xor edi, edi
add ebx, ebp
mov ecx, edx
jmp [draw_line]
; jmp [draw_line]
jmp __sys_draw_line
align 4

View File

@ -421,7 +421,8 @@ align 4
jnz .outer32
.done:
call [draw_pointer]
; call [draw_pointer]
call __sys_draw_pointer
.L57:
add esp, 72
pop ebx

View File

@ -285,8 +285,12 @@ align 4
;--------------------------------------
put_image_end_24:
mov edi, [putimg.real_sy]
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne put_image_end_24_new
je put_image_end_24_old
cmp [_display.select_cursor], select_cursor
je put_image_end_24_new
;--------------------------------------
align 4
.new_line:
@ -300,23 +304,6 @@ align 4
cmp [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne .no_mouseunder
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
@ -355,8 +342,68 @@ align 4
add esp, putimg.stack_data
popad
ret
;------------------------------------------------------------------------------
align 4
put_image_end_24_old:
;--------------------------------------
align 4
.new_line:
mov ecx, [putimg.real_sx]
;--------------------------------------
align 4
.new_x:
push [putimg.edi]
mov eax, [putimg.ebp+4]
call eax
cmp [ebp], bl
jne .skip
;--------------------------------------
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
; store to real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
mov [LFB_BASE+edx+2], al
;--------------------------------------
align 4
.skip:
add edx, 3
inc ebp
dec ecx
jnz .new_x
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_24.finish
;------------------------------------------------------------------------------
align 4
put_image_end_24_new:
;--------------------------------------
align 4
@ -371,10 +418,6 @@ align 4
cmp [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
jne .no_mouseunder
push ecx
mov ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
@ -403,9 +446,6 @@ align 4
align 4
.no_mouse_area:
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edx], ax
shr eax, 16
@ -443,8 +483,12 @@ align 4
align 4
put_image_end_32:
mov edi, [putimg.real_sy]
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne put_image_end_32_new
je put_image_end_32_old
cmp [_display.select_cursor], select_cursor
je put_image_end_32_new
;--------------------------------------
align 4
.new_line:
@ -458,24 +502,6 @@ align 4
cmp [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne .no_mouseunder
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
@ -519,8 +545,66 @@ align 4
@@:
mov [EGA_counter], 1
ret
;------------------------------------------------------------------------------
align 4
put_image_end_32_old:
;--------------------------------------
align 4
.new_line:
mov ecx, [putimg.real_sx]
;--------------------------------------
align 4
.new_x:
push [putimg.edi]
mov eax, [putimg.ebp+4]
call eax
cmp [ebp], bl
jne .skip
;--------------------------------------
push ecx
neg ecx
add ecx, [putimg.real_sx_and_abs_cx + 4]
shl ecx, 16
add ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
pop ecx
; store to real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
align 4
.skip:
add edx, 4
inc ebp
dec ecx
jnz .new_x
add esi, [putimg.line_increment]
add edx, [putimg.screen_newline];[BytesPerScanLine]
add ebp, [putimg.winmap_newline];[Screen_Max_X]
cmp [putimg.ebp], putimage_get1bpp
jz .correct
cmp [putimg.ebp], putimage_get2bpp
jz .correct
cmp [putimg.ebp], putimage_get4bpp
jnz @f
;--------------------------------------
align 4
.correct:
mov eax, [putimg.edi]
mov byte [eax], 80h
;--------------------------------------
align 4
@@:
dec edi
jnz .new_line
jmp put_image_end_32.finish
;------------------------------------------------------------------------------
align 4
put_image_end_32_new:
;--------------------------------------
align 4
@ -535,9 +619,6 @@ align 4
cmp [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
jne .no_mouseunder
push ecx
mov ecx, [putimg.real_sy_and_abs_cy + 4]
sub ecx, edi
@ -566,9 +647,6 @@ align 4
align 4
.no_mouse_area:
pop ecx
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [LFB_BASE+edx], eax
;--------------------------------------
@ -975,7 +1053,8 @@ align 4
;--------------------------------------
shr ebx, 16
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
pop ebx eax
add ebx, ebp ; y = y+dy
add eax, esi ; x = x+dx
@ -985,7 +1064,8 @@ align 4
mov eax, [dl_x2]
mov ebx, [dl_y2]
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
;--------------------------------------
align 4
.exit:
@ -1010,7 +1090,8 @@ hline:
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
inc eax
cmp eax, edx
jle @b
@ -1033,7 +1114,8 @@ vline:
align 4
@@:
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
; call [putpixel]
call __sys_putpixel
inc ebx
cmp ebx, edx
jle @b
@ -1199,8 +1281,12 @@ draw_bar_end_24:
; edx - pointer to screen
; esi - counter
; edi - counter
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne draw_bar_end_24_new
je draw_bar_end_24_old
cmp [_display.select_cursor], select_cursor
je draw_bar_end_24_new
;--------------------------------------
align 4
.new_y:
@ -1211,26 +1297,10 @@ align 4
cmp byte [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne .no_mouseunder
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [edx], ax
shr eax, 16
mov [edx + 2], al
mov eax, [drbar.color]
;--------------------------------------
align 4
.skip:
@ -1260,8 +1330,56 @@ align 4
popad
xor eax, eax
ret
;------------------------------------------------------------------------------
align 4
draw_bar_end_24_old:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
;--------------------------------------
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
; store to real LFB
mov [edx], ax
shr eax, 16
mov [edx + 2], al
mov eax, [drbar.color]
;--------------------------------------
align 4
.skip:
; add pixel
add edx, 3
inc ebp
dec edi
jnz .new_x
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_24.end
;------------------------------------------------------------------------------
align 4
draw_bar_end_24_new:
;--------------------------------------
align 4
@ -1273,10 +1391,6 @@ align 4
cmp byte [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
jne .no_mouse_area
mov ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
;--------------------------------------
@ -1336,7 +1450,7 @@ align 4
dec esi
jnz .new_y
jmp draw_bar_end_24.end
;--------------------------------------
;------------------------------------------------------------------------------
align 4
draw_bar_end_32:
; eax - color high RRGGBB
@ -1345,8 +1459,12 @@ draw_bar_end_32:
; edx - pointer to screen
; esi - counter
; edi - counter
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne draw_bar_end_32_new
je draw_bar_end_32_old
cmp [_display.select_cursor], select_cursor
je draw_bar_end_32_new
;--------------------------------------
align 4
.new_y:
@ -1357,21 +1475,6 @@ align 4
cmp byte [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], 0
jne .no_mouseunder
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
;--------------------------------------
align 4
.no_mouseunder:
; store to real LFB
mov [edx], eax
mov eax, [drbar.color]
@ -1411,8 +1514,55 @@ align 4
xor eax, eax
mov [EGA_counter], 1
ret
;------------------------------------------------------------------------------
align 4
draw_bar_end_32_old:
;--------------------------------------
align 4
.new_y:
mov edi, [drbar.real_sx]
;--------------------------------------
align 4
.new_x:
cmp byte [ebp], bl
jne .skip
;--------------------------------------
mov ecx, [drbar.real_sx_and_abs_cx]
sub ecx, edi
shl ecx, 16
add ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
; check mouse area for putpixel
call check_mouse_area_for_putpixel
; store to real LFB
mov [edx], eax
mov eax, [drbar.color]
;--------------------------------------
align 4
.skip:
; add pixel
add edx, 4
inc ebp
dec edi
jnz .new_x
; add line
add edx, [drbar.line_inc_scr]
add ebp, [drbar.line_inc_map]
; drawing gradient bars
test bh, 0x80
jz @f
test al, al
jz @f
dec al
;--------------------------------------
align 4
@@:
dec esi
jnz .new_y
jmp draw_bar_end_32.end
;------------------------------------------------------------------------------
align 4
draw_bar_end_32_new:
;--------------------------------------
align 4
@ -1424,10 +1574,6 @@ align 4
cmp byte [ebp], bl
jne .skip
;--------------------------------------
; check for hardware cursor
cmp [_display.select_cursor], select_cursor
jne .no_mouse_area
mov ecx, [drbar.real_sy_and_abs_cy]
sub ecx, esi
;--------------------------------------