Subversion Repositories Kolibri OS

Rev

Rev 6873 | Rev 6888 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6873 Rev 6881
Line 629... Line 629...
629
if PNG_USER_MEM_SUPPORTED eq 1
629
if PNG_USER_MEM_SUPPORTED eq 1
630
	stdcall png_create_png_struct, [user_png_ver], [error_ptr], [error_fn], [warn_fn], 0, 0, 0
630
	stdcall png_create_png_struct, [user_png_ver], [error_ptr], [error_fn], [warn_fn], 0, 0, 0
631
	;eax = png_ptr
631
	;eax = png_ptr
632
end if ;USER_MEM
632
end if ;USER_MEM
633
	cmp eax,0
633
	test eax,eax
634
	je .end0 ;if (..!=0)
634
	jz .end0 ;if (..!=0)
635
		; Set the zlib control values to defaults; they can be overridden by the
635
		; Set the zlib control values to defaults; they can be overridden by the
636
		; application after the struct has been created.
636
		; application after the struct has been created.
637
 
637
 
Line 638... Line 638...
638
		mov dword[eax+png_struct.zbuffer_size], PNG_ZBUF_SIZE
638
		mov dword[eax+png_struct.zbuffer_size], PNG_ZBUF_SIZE
Line 1837... Line 1837...
1837
	mov ebx,[image]
1837
	mov ebx,[image]
1838
	stdcall png_create_write_struct, PNG_LIBPNG_VER_STRING, ebx, png_safe_error, png_safe_warning
1838
	stdcall png_create_write_struct, PNG_LIBPNG_VER_STRING, ebx, png_safe_error, png_safe_warning
1839
	;eax = png_ptr
1839
	;eax = png_ptr
1840
 
1840
 
Line 1841... Line 1841...
1841
	cmp eax,0
1841
	test eax,eax
1842
	je .end0 ;if (..!=0)
1842
	jz .end0 ;if (..!=0)
1843
		mov edi,eax
1843
		mov edi,eax
1844
		stdcall png_create_info_struct, edi
1844
		stdcall png_create_info_struct, edi
1845
		;eax = info_ptr
1845
		;eax = info_ptr
Line 1846... Line 1846...
1846
 
1846
 
1847
		cmp eax,0
1847
		test eax,eax
1848
		je .end1 ;if (..!=0)
1848
		jz .end1 ;if (..!=0)
1849
			mov esi,eax
1849
			mov esi,eax
1850
			stdcall png_malloc_warn, edi, sizeof.png_control
1850
			stdcall png_malloc_warn, edi, sizeof.png_control
Line 1851... Line 1851...
1851
			;control = eax
1851
			;control = eax
1852
 
1852
 
1853
			cmp eax,0
1853
			test eax,eax
1854
			je .end2 ;if (..!=0)
1854
			jz .end2 ;if (..!=0)
1855
				push eax
1855
				push eax
1856
				mov edx,edi ; edx = png_ptr
1856
				mov edx,edi ; edx = png_ptr
1857
				mov ecx,sizeof.png_control
1857
				mov ecx,sizeof.png_control
Line 2743... Line 2743...
2743
 
2743
 
Line 2744... Line 2744...
2744
		stdcall png_free, edi, ecx
2744
		stdcall png_free, edi, ecx
Line 2745... Line 2745...
2745
 
2745
 
2746
		; Skip the 'write_end' on error:
2746
		; Skip the 'write_end' on error:
2747
		cmp eax,0
2747
		test eax,eax
2748
		je .end_f ;if (..==0) return 0
2748
		jz .end_f ;if (..==0) return 0
Line 2749... Line 2749...
2749
		jmp .end8
2749
		jmp .end8
2750
 
2750
 
Line 2791... Line 2791...
2791
png_debug 1, 'IDAT compress all'
2791
png_debug 1, 'IDAT compress all'
2792
 
2792
 
Line 2793... Line 2793...
2793
	;create buffer with filters
2793
	;create buffer with filters
2794
	stdcall png_zalloc, edi, 1, [len]
2794
	stdcall png_zalloc, edi, 1, [len]
2795
	cmp eax,0
2795
	test eax,eax
2796
	je .end_f
2796
	jz .end_f
2797
	mov [buf_f],eax
2797
	mov [buf_f],eax
Line 2798... Line 2798...
2798
 
2798
 
2799
	mov eax,ZLIB_IO_MAX
2799
	mov eax,ZLIB_IO_MAX
2800
	cmp eax,[len]
2800
	cmp eax,[len]
2801
	jge @f
2801
	jge @f
2802
		mov eax,[len]
2802
		mov eax,[len]
2803
	@@:
2803
	@@:
2804
	stdcall png_zalloc, edi, 1, eax
2804
	stdcall png_zalloc, edi, 1, eax
2805
	cmp eax,0
2805
	test eax,eax
2806
	je .end0
2806
	jz .end0
Line 2807... Line 2807...
2807
	mov [m1],eax
2807
	mov [m1],eax
2808
 
2808
 
2809
	;init buffer with filters
2809
	;init buffer with filters
Line 3098... Line 3098...
3098
				mov dword[eax],0
3098
				mov dword[eax],0
3099
			@@:
3099
			@@:
3100
 
3100
 
Line 3101... Line 3101...
3101
			stdcall png_image_write_init, ebx
3101
			stdcall png_image_write_init, ebx
3102
			cmp eax,0
3102
			test eax,eax
3103
			je .end3 ;if (..!=0)
3103
			jz .end3 ;if (..!=0)
3104
				mov ecx,sizeof.png_image_write_control
3104
				mov ecx,sizeof.png_image_write_control
3105
				mov edi,ebp
3105
				mov edi,ebp
3106
				sub edi,ecx
3106
				sub edi,ecx
3107
				xor eax,eax
3107
				xor eax,eax
3108
				rep stosb ;memset(&display, 0, sizeof.display))
3108
				rep stosb ;memset(&display, 0, sizeof.display))