From 6e1421b3b8cb126698dd8298c6dcaf9aaf2e0ace Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 6 Mar 2010 18:12:37 +0000 Subject: [PATCH] stuff --- ChangeLog | 5 +++++ libvips/inplace/flood.c | 9 +++------ libvips/inplace/im_circle.c | 5 +++-- libvips/inplace/im_insertplace.c | 5 +++-- libvips/inplace/im_paintrect.c | 5 +++-- libvips/inplace/im_plotmask.c | 5 +++-- libvips/inplace/line_draw.c | 7 +++---- libvips/inplace/plot_point.c | 5 +++-- libvips/inplace/smudge_area.c | 7 +++---- 9 files changed, 29 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4e3f6bf..648c8781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,11 @@ - 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 +- don't im_invalidate() after paint, it can cause horrible performance + problems ... for example, im_plotmask() used as the action operator for + im_fastlineuser() is terrible +- instead, users of the inplace operations need to call im_invalidate() at the + end of a set of paint actions to trigger an update 15/1/10 started 7.21.1 - added "written" callbacks, used to implement write to non-vips formats diff --git a/libvips/inplace/flood.c b/libvips/inplace/flood.c index 7f37ee93..7741a90c 100644 --- a/libvips/inplace/flood.c +++ b/libvips/inplace/flood.c @@ -23,6 +23,9 @@ * - allow separate test and mark images * 22/1/10 * - flood_blob could loop if start point == ink + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -472,8 +475,6 @@ im_flood( IMAGE *im, int x, int y, PEL *ink, Rect *dout ) flood_free( flood ); - im_invalidate( im ); - return( 0 ); } @@ -529,8 +530,6 @@ im_flood_blob( IMAGE *im, int x, int y, PEL *ink, Rect *dout ) flood_free( flood ); - im_invalidate( im ); - return( 0 ); } @@ -591,8 +590,6 @@ im_flood_other( IMAGE *test, IMAGE *mark, int x, int y, int serial, Rect *dout ) flood_free( flood ); - im_invalidate( mark ); - return( 0 ); } diff --git a/libvips/inplace/im_circle.c b/libvips/inplace/im_circle.c index 170492d6..fad05f86 100644 --- a/libvips/inplace/im_circle.c +++ b/libvips/inplace/im_circle.c @@ -18,6 +18,9 @@ * - im_incheck() changed to im_makerw() * 5/12/06 * - im_invalidate() after paint + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -128,7 +131,5 @@ im_circle( IMAGE *im, int cx, int cy, int radius, int intensity ) *(start + offset - size * x + y) = (PEL)intensity; } - im_invalidate( im ); - return(0); } diff --git a/libvips/inplace/im_insertplace.c b/libvips/inplace/im_insertplace.c index 2dc6b9cc..eb0e9b97 100644 --- a/libvips/inplace/im_insertplace.c +++ b/libvips/inplace/im_insertplace.c @@ -16,6 +16,9 @@ * 21/10/09 * - allow sub to be outside main * - gtkdoc + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -118,7 +121,5 @@ im_insertplace( IMAGE *main, IMAGE *sub, int x, int y ) q += IM_IMAGE_SIZEOF_LINE( main ); } - im_invalidate( main ); - return( 0 ); } diff --git a/libvips/inplace/im_paintrect.c b/libvips/inplace/im_paintrect.c index 79587a40..ba163683 100644 --- a/libvips/inplace/im_paintrect.c +++ b/libvips/inplace/im_paintrect.c @@ -14,6 +14,9 @@ * - im_incheck() changed to im_makerw() * 5/12/06 * - im_invalidate() after paint + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -98,8 +101,6 @@ im_paintrect( IMAGE *im, Rect *r, PEL *ink ) to += ls; } - im_invalidate( im ); - return( 0 ); } diff --git a/libvips/inplace/im_plotmask.c b/libvips/inplace/im_plotmask.c index c4edc17a..0ad76fcd 100644 --- a/libvips/inplace/im_plotmask.c +++ b/libvips/inplace/im_plotmask.c @@ -18,6 +18,9 @@ * - now blends with 0-255 mask * 5/12/06 * - im_invalidate() after paint + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -233,8 +236,6 @@ im_plotmask( IMAGE *im, int ix, int iy, PEL *ink, PEL *mask, Rect *r ) } } - im_invalidate( im ); - return( 0 ); } diff --git a/libvips/inplace/line_draw.c b/libvips/inplace/line_draw.c index 7a790de6..aa1c826c 100644 --- a/libvips/inplace/line_draw.c +++ b/libvips/inplace/line_draw.c @@ -42,6 +42,9 @@ * - im_invalidate() after paint * 1/3/10 * - oops, lineset needs to ask for WIO of mask and ink + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -249,8 +252,6 @@ im_fastline( IMAGE *im, int x1, int y1, int x2, int y2, PEL *pel ) else error_exit( "internal error #9872659823475982375" ); - im_invalidate( im ); - return( 0 ); } @@ -397,8 +398,6 @@ im_fastlineuser( IMAGE *im, else error_exit( "internal error #9872659823475982375" ); - im_invalidate( im ); - return( 0 ); } diff --git a/libvips/inplace/plot_point.c b/libvips/inplace/plot_point.c index 924942f2..723975da 100644 --- a/libvips/inplace/plot_point.c +++ b/libvips/inplace/plot_point.c @@ -16,6 +16,9 @@ * - im_incheck() changed to im_makerw() * 5/12/06 * - im_invalidate() after paint + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -113,7 +116,5 @@ im_plotpoint( IMAGE *im, int x, int y, PEL *pel ) for( b = 0; b < ps; b++ ) *to++ = *pel++; - im_invalidate( im ); - return( 0 ); } diff --git a/libvips/inplace/smudge_area.c b/libvips/inplace/smudge_area.c index 8c534c21..409ff598 100644 --- a/libvips/inplace/smudge_area.c +++ b/libvips/inplace/smudge_area.c @@ -22,6 +22,9 @@ * - im_makerw() changed to im_rwcheck() * 5/12/06 * - im_invalidate() after paint + * 6/3/10 + * - don't im_invalidate() after paint, this now needs to be at a higher + * level */ /* @@ -187,8 +190,6 @@ im_smudge( IMAGE *im, int ix, int iy, Rect *r ) } - im_invalidate( im ); - return( 0 ); } @@ -313,7 +314,5 @@ im_smear( IMAGE *im, int ix, int iy, Rect *r ) return( -1 ); } - im_invalidate( im ); - return( 0 ); }