Skip to content
  • Ell's avatar
    buffer: add gegl_tile_backend_command(); pre-0.4.10 compatibility · 30047e65
    Ell authored
    Tile backends currently assert in their command handlers that the
    input command is between 0 and GEGL_TILE_LAST_COMMAND (this is true
    for the built-in backends, but we can assume it's also true for
    custom backends.)  This prevents us from adding new tile commands
    without breaking the ABI.
    
    Instead, add a new gegl_tile_backend_command() function, which acts
    as a default command handler for tile backends, and to which their
    handlers should forward unhandled commands (this function currently
    simply performs the range check for the command -- however, against
    the GEGL_TILE_LAST_COMMAND value of the runtime GEGL -- and returns
    NULL; we can add differet default behaviors for different commands
    as necessary.)
    
    In order to remain backward compatible with tile backends compiled
    against older versions of GEGL, which still contain the above
    assertion, we replace the subclass's command handler with a thunk
    upon construction, which tests whether the original handler
    forwards unhandled commands to gegl_tile_backend_command(), and re-
    replaces the handler with either the original handler if it does,
    or a compatibility shim, which only forwards pre-0.4.10 commands to
    the original handler, if it doesn't.
    30047e65