[Verse-dev] gimp plug-in hacking

Brecht Van Lommel brechtvanlommel at pandora.be
Mon Feb 13 14:22:11 CET 2006


Hi,

Jiri and I are working on improving the gimp plug-in. Jiri committed the
sources to a separate project on projects.blender.org. I've been looking
into some of the performance problems and trying to get rid of the stupid
upload/download switch.

I hacked the gimp sources so it can signal the plug-in on changes to
images, to avoid it from having to diff the tiles continously. It's still
very much a hack, since the gimp plug-in interface wasn't intended for
this type of interaction at all, but seems to be working rather predictable
now. I'll commit the patch and changes to the verse plug-in once I've made
the diffing working again in my code, so it still works without a patched
gimp.

I've also found that the plug-in isn't using the gimp interface very efficiently.
I'm coding a solution for that, but it's not yet finished. For downloading
I'll have it keep the gimp tile references during verse_callback_update,
so changes can be written immediate, and then flushed at the end. Should
be more efficient than what it does now.


Getting rid of the upload/download modes is proving to be quite difficult
though. Basically there's a synchronization problem  that I can't figure
out how to solve. It happens for example in this scenario (assume there is
only one tile in the image):

- user starts painting stroke
- gimp plug-in sends tile with contents A
- user continues painting
- gimp plug-in sends tile with contents B
- user stops painting stroke
- gimp plug-in receives tile with contents A
- user paints over outdated tile with contents A

The only problem to this solution I can think of is that the plug-in would
ignore it's own tiles. But there seems to be no way to do this reliable
without the verse server telling which ones are the plug-in's own tiles.

These are the only solutions I can come up with, but none of the are
really good:

- Only send tiles after the stroke is painted. But if multiple strokes are
    painted right after each other the problem can still occur.
- Ignore incoming tiles on a specific position a few seconds after sending
    a tile from that position. Doesn't work when there is heavy lagging,
    and we may end up ignoring tiles from other apps, and get out of sync.
- Hack the verse server?

Maybe the solution is simple, but I can't think of any. The gimp 1 plug-in
had the same problem, and if I recall correctly this was exactly why
I added the modes 2 years ago. Any ideas?

Cheers,
Brecht


More information about the Verse-dev mailing list