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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Sep 3 13:46:31 PDT 2010


           Summary: surface change serial
           Product: cairo
           Version: 1.9.15
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: cworth at cworth.org
        ReportedBy: hp at pobox.com
         QAContact: cairo-bugs at cairographics.org

What do you think of an API like:

uint32_t cairo_surface_get_change_serial(cairo_surface_t*);

where cairo surface would keep a serial that cairo increments whenever it
modifies the surface or someone calls mark_dirty().

The purpose would be to allow caching something based on the surface.
For example for an image surface, in GdkPixbuf we might cache a converted copy
of the pixels in the GdkPixbuf format. Or for GDK, it might be nice to cache an
X-server-side copy of certain images.

the intended usage is:

 cache_something(surface) {
    if (cache.serial != cairo_surface_get_change_serial(surface)) {
      cache.something = something_based_on_surface(surface);
      cache.serial = cairo_surface_get_change_serial(surface);

Since the serial is just checked for equality, don't think it matters that it
will wrap around eventually. may not need 32 bits. (could even keep anyone from
relying on sequence by rearranging some bits when returning the serial, to be

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