use a tile cache to optimize pixel access.

2008-12-17  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/file-png.c (load_image) (save_image): use a 
tile
	cache to optimize pixel access.


svn path=/trunk/; revision=27805
This commit is contained in:
Sven Neumann 2008-12-17 19:23:25 +00:00 committed by Sven Neumann
parent e8b1a48ab5
commit a6f377dd02
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2008-12-17 Sven Neumann <sven@gimp.org>
* plug-ins/common/file-png.c (load_image) (save_image): use a tile
cache to optimize pixel access.
2008-12-16 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb/plug_in.pdb: improved docs for

View File

@ -977,6 +977,8 @@ load_image (const gchar *filename,
for (i = 0; i < tile_height; i++)
pixels[i] = pixel + info->width * info->channels * i;
gimp_tile_cache_ntiles (1 + drawable->width / gimp_tile_width ());
/* Install our own error handler to handle incomplete PNG files better */
error_data.drawable = drawable;
error_data.pixel = pixel;
@ -1487,6 +1489,8 @@ save_image (const gchar *filename,
pixel = g_new (guchar, tile_height * drawable->width * bpp);
pixels = g_new (guchar *, tile_height);
gimp_tile_cache_ntiles (1 + drawable->width / gimp_tile_width ());
for (i = 0; i < tile_height; i++)
pixels[i] = pixel + drawable->width * bpp * i;