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_vips2tiff has a bigtiff option
- 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
- 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
imagine building the pipeline

View File

@ -44,8 +44,8 @@
*/
/*
#define DEBUG
#define DEBUG_CREATE
#define DEBUG
*/
#ifdef HAVE_CONFIG_H
@ -193,9 +193,9 @@ im_buffer_done( im_buffer_t *buffer )
im_buffer_cache_list_t *cache_list;
#ifdef DEBUG
printf( "im_buffer_done: thread %p adding "
"buffer %p to cache %p\n",
g_thread_self(), buffer, cache );
printf( "im_buffer_done: thread %p adding to cache %p\n",
g_thread_self(), cache );
im_buffer_print( buffer );
#endif /*DEBUG*/
/* Look up and update the buffer list.
@ -246,7 +246,7 @@ im_buffer_undone( im_buffer_t *buffer )
#ifdef DEBUG
printf( "im_buffer_undone: %d buffers left\n",
g_slist_length( buffers ) );
g_slist_length( cache_list->buffers ) );
#endif /*DEBUG*/
}
}
@ -432,7 +432,7 @@ im_buffer_unref_ref( im_buffer_t *old_buffer, IMAGE *im, Rect *area )
/* Is the current buffer OK?
*/
if( old_buffer &&
im_rect_includesrect( &old_buffer->area, area ) )
im_rect_includesrect( &old_buffer->area, area ) )
return( old_buffer );
/* Does the new area already have a buffer?

View File

@ -489,8 +489,6 @@ im_invalidate( IMAGE *im )
{
GSList *to_be_invalidated;
return;
/* Invalidate callbacks might do anything, including removing images
* or invalidating other images, so we can't trigger them from within
* 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;
im__region_no_ownership( tile->region );
/* Now clients can update.
*/
if( render->notify )
render->notify( render->out,
&tile->area, render->client );

View File

@ -456,7 +456,7 @@ im_region_buffer( REGION *reg, Rect *r )
* buffer ref in one call to reduce malloc/free cycling.
*/
IM_FREEF( im_window_unref, reg->window );
if( !(reg->buffer = im_buffer_unref_ref( reg->buffer, im, &clipped )) )
if( !(reg->buffer = im_buffer_unref_ref( reg->buffer, im, &clipped )) )
return( -1 );
/* If we've been asked to drop caches, flag this as undone.
@ -743,8 +743,8 @@ im_region_fill( REGION *reg, Rect *r, im_region_fill_fn fn, void *a )
return( -1 );
/* Evaluate into or, if we've not got calculated pixels.
if( !reg->buffer->done ) {
*/
if( !reg->buffer->done ) {
if( fn( reg, a ) )
return( -1 );
@ -752,7 +752,7 @@ im_region_fill( REGION *reg, Rect *r, im_region_fill_fn fn, void *a )
*/
if( reg->buffer )
im_buffer_done( reg->buffer );
//}
}
return( 0 );
}