fix paintbox speed - #65
Open
jcupitt wants to merge 1 commit into
Open
Conversation
When drawing wide lines, draw_line was calling vips_image_inplace() and vips_image_wio_input() for each pixel. This triggered invalidate, and when the operation cache was full of cached getpoint() calls from the info bar, made drawing very slow. This might fix the crashes with paint + infobar enabled too.
Member
Author
|
@kleisauke this might fix the infobar crashes too, I'm not certain. |
Member
Author
|
Ooop, nope, it just crashed again. It's a lot quicker though, so that's nice. |
Member
|
Nice! It does seem much faster, although I was also able to provoke a crash. :( Looking at the doc comment for How about adding the same check we added to --- a/libvips/iofuncs/image.c
+++ b/libvips/iofuncs/image.c
@@ -3600,6 +3600,14 @@ vips__image_wio_output(VipsImage *image)
int
vips_image_inplace(VipsImage *image)
{
+#ifdef DEBUG_LEAK
+ /* Warn if inplace is being called on a shared image.
+ */
+ if (vips__leak &&
+ G_OBJECT(image)->ref_count > 2)
+ printf("vips_image_inplace: shared image %p\n", image);
+#endif /*DEBUG_LEAK*/
+
/* Do an vips_image_wio_input(). This will rewind, generate, etc.
*/
if (vips_image_wio_input(image))I noticed that this warning is triggered when painting, but I'm not sure whether it's a red herring. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When drawing wide lines, draw_line was calling vips_image_inplace() and vips_image_wio_input() for each pixel. This triggered invalidate, and when the operation cache was full of cached getpoint() calls from the info bar, made drawing very slow.
This might fix the crashes with paint + infobar enabled too.