Add paginated surface backend function _set_fallback_images_required

This commit is contained in:
Adrian Johnson 2008-07-08 21:12:54 +09:30
parent 0c05aa60f5
commit 4fcdc364cd
2 changed files with 17 additions and 0 deletions

View file

@ -67,6 +67,14 @@ struct _cairo_paginated_surface_backend {
cairo_warn cairo_int_status_t
(*set_bounding_box) (void *surface,
cairo_box_t *bbox);
/* Optional. Indicates whether the page requires fallback images.
* Will be called at the end of the ANALYZE phase but before the
* mode is changed to RENDER.
*/
cairo_warn cairo_int_status_t
(*set_fallback_images_required)(void *surface,
cairo_bool_t fallbacks_required);
};
/* A #cairo_paginated_surface_t provides a very convenient wrapper that

View file

@ -316,6 +316,15 @@ _paint_page (cairo_paginated_surface_t *surface)
goto FAIL;
}
if (surface->backend->set_fallback_images_required) {
cairo_bool_t has_fallbacks = _cairo_analysis_surface_has_unsupported (analysis);
status = surface->backend->set_fallback_images_required (surface->target,
has_fallbacks);
if (status)
goto FAIL;
}
surface->backend->set_paginated_mode (surface->target, CAIRO_PAGINATED_MODE_RENDER);
/* Finer grained fallbacks are currently only supported for some