fix to buffer caching

This commit is contained in:
John Cupitt 2010-03-06 17:42:17 +00:00
parent 7195901313
commit 8b24518422
6 changed files with 13 additions and 15 deletions

View File

@ -20,6 +20,7 @@
- im_csv2vips(): allow lines that end with EOF rather than \n - im_csv2vips(): allow lines that end with EOF rather than \n
- im_vips2tiff has a bigtiff option - im_vips2tiff has a bigtiff option
- oops, im_lineset() needs to ask for WIO of mask and ink - oops, im_lineset() needs to ask for WIO of mask and ink
- move cache invalidation to REGION, fixes a race
15/1/10 started 7.21.1 15/1/10 started 7.21.1
- added "written" callbacks, used to implement write to non-vips formats - added "written" callbacks, used to implement write to non-vips formats

4
TODO
View File

@ -1,7 +1,3 @@
- argh, regions are all broken
- what's the difference between private.h and internal.h?
- we use parent/child a lot, but it's confusing - we use parent/child a lot, but it's confusing
imagine building the pipeline imagine building the pipeline

View File

@ -44,8 +44,8 @@
*/ */
/* /*
#define DEBUG
#define DEBUG_CREATE #define DEBUG_CREATE
#define DEBUG
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
@ -193,9 +193,9 @@ im_buffer_done( im_buffer_t *buffer )
im_buffer_cache_list_t *cache_list; im_buffer_cache_list_t *cache_list;
#ifdef DEBUG #ifdef DEBUG
printf( "im_buffer_done: thread %p adding " printf( "im_buffer_done: thread %p adding to cache %p\n",
"buffer %p to cache %p\n", g_thread_self(), cache );
g_thread_self(), buffer, cache ); im_buffer_print( buffer );
#endif /*DEBUG*/ #endif /*DEBUG*/
/* Look up and update the buffer list. /* Look up and update the buffer list.
@ -246,7 +246,7 @@ im_buffer_undone( im_buffer_t *buffer )
#ifdef DEBUG #ifdef DEBUG
printf( "im_buffer_undone: %d buffers left\n", printf( "im_buffer_undone: %d buffers left\n",
g_slist_length( buffers ) ); g_slist_length( cache_list->buffers ) );
#endif /*DEBUG*/ #endif /*DEBUG*/
} }
} }

View File

@ -489,8 +489,6 @@ im_invalidate( IMAGE *im )
{ {
GSList *to_be_invalidated; GSList *to_be_invalidated;
return;
/* Invalidate callbacks might do anything, including removing images /* Invalidate callbacks might do anything, including removing images
* or invalidating other images, so we can't trigger them from within * or invalidating other images, so we can't trigger them from within
* the image loop. Instead we collect a list of image to invalidate * the image loop. Instead we collect a list of image to invalidate

View File

@ -410,6 +410,9 @@ render_dirty_process( Render *render )
*/ */
tile->state = TILE_PAINTED; tile->state = TILE_PAINTED;
im__region_no_ownership( tile->region ); im__region_no_ownership( tile->region );
/* Now clients can update.
*/
if( render->notify ) if( render->notify )
render->notify( render->out, render->notify( render->out,
&tile->area, render->client ); &tile->area, render->client );

View File

@ -743,8 +743,8 @@ im_region_fill( REGION *reg, Rect *r, im_region_fill_fn fn, void *a )
return( -1 ); return( -1 );
/* Evaluate into or, if we've not got calculated pixels. /* Evaluate into or, if we've not got calculated pixels.
if( !reg->buffer->done ) {
*/ */
if( !reg->buffer->done ) {
if( fn( reg, a ) ) if( fn( reg, a ) )
return( -1 ); return( -1 );
@ -752,7 +752,7 @@ im_region_fill( REGION *reg, Rect *r, im_region_fill_fn fn, void *a )
*/ */
if( reg->buffer ) if( reg->buffer )
im_buffer_done( reg->buffer ); im_buffer_done( reg->buffer );
//} }
return( 0 ); return( 0 );
} }