[cairo-bugs] [Bug 30003] surface change serial

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Sep 3 21:43:52 PDT 2010


--- Comment #2 from Havoc Pennington <hp at pobox.com> 2010-09-03 21:43:50 PDT ---
I haven't seen Søren's proposal, link? The serial approach has the advantage of
being trivial to implement and zero-overhead...

Agree a signal is more flexible, but it would have to cover all changes, not
just "external" changes like mark_dirty does now.

how are you going to do signals in cairo? (have to say: once you're adding
signals the gobject reinvention is getting painful. signals are pretty hard,
too, if you handle all the weird reentrancy cases only Tim Janik can keep track

A damage-based API could be nice. Would probably want to allow multiple damage
regions per surface, like

damage* damage_create(surface)
region* damage_subtract(damage)

you could also put a callback here like:
 damage_set_notify(damage, callback, data, dnotify_data)

rather than trying to do a full "signal system" 

fwiw, this is overkill for the two cases I had in mind (detect when to copy
cairo pixels to gdkpixbuf pixels; detect when to update a server-side copy of
an image surface). The cache invalidation serial is totally fine for
cache-expiration purposes.

But I can imagine uses for damage too. For example an incremental image loader
could just hand a surface to something like GtkImage and have things magically
work. (GtkImage would get damage as new pixels arrived.)

Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the cairo-bugs mailing list