Display list device – record and play back device commands.
typedef struct fz_display_list fz_display_list
fz_display_list is a list containing drawing commands (text, images, etc.). The intent is two-fold: as a caching-mechanism to reduce parsing of a page, and to be used as a data structure in multi-threading where one thread parses the page and another renders pages.
Create a display list with fz_new_display_list, hand it over to fz_new_list_device to have it populated, and later replay the list (once or many times) by calling fz_run_display_list. When the list is no longer needed drop it with fz_drop_display_list.
fz_display_list *
fz_new_display_list (
fz_context *ctx,
fz_rect mediabox
)
Create an empty display list.
A display list contains drawing commands (text, images, etc.). Use fz_new_list_device for populating the list.
fz_device *
fz_new_list_device (
fz_context *ctx,
fz_display_list *list
)
Create a rendering device for a display list.
When the device is rendering a page it will populate the display list with drawing commands (text, images, etc.). The display list can later be reused to render a page many times without having to re-interpret the page from the document file for each rendering. Once the device is no longer needed, free it with fz_drop_device.
void
fz_run_display_list (
fz_context *ctx,
fz_display_list *list,
fz_device *dev,
fz_matrix ctm,
fz_rect scissor,
fz_cookie *cookie
)
(Re)-run a display list through a device.
fz_display_list *
fz_keep_display_list (
fz_context *ctx,
fz_display_list *list
)
Increment the reference count for a display list. Returns the same pointer.
Never throws exceptions.
void
fz_drop_display_list (
fz_context *ctx,
fz_display_list *list
)
Decrement the reference count for a display list. When the reference count reaches zero, all the references in the display list itself are dropped, and the display list is freed.
Never throws exceptions.
fz_rect
fz_bound_display_list (
fz_context *ctx,
fz_display_list *list
)
Return the bounding box of the page recorded in a display list.
fz_image *
fz_new_image_from_display_list (
fz_context *ctx,
float w,
float h,
fz_display_list *list
)
Create a new image from a display list.
int
fz_display_list_is_empty (
fz_context *ctx,
const fz_display_list *list
)
Check for a display list being empty
Returns true if empty, false otherwise.