From 6c68b2e4e2ae93ca814129a6b1a03ab57a32ce7c Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 13 Feb 2013 13:58:21 +0100 Subject: Update doc/multi-threaded.c for passing rect/matrix by reference. --- doc/multi-threaded.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/multi-threaded.c b/doc/multi-threaded.c index af4bab97..70f66660 100644 --- a/doc/multi-threaded.c +++ b/doc/multi-threaded.c @@ -95,7 +95,7 @@ renderer(void *data) fprintf(stderr, "thread at page %d rendering!\n", pagenumber); fz_device *dev = fz_new_draw_device(ctx, pix); - fz_run_display_list(list, dev, fz_identity, bbox, NULL); + fz_run_display_list(list, dev, &fz_identity, &bbox, NULL); fz_free_device(dev); // This threads context is freed. @@ -180,7 +180,9 @@ int main(int argc, char **argv) // Compute the bounding box for each page. - fz_rect bbox = fz_bound_page(doc, page); + fz_rect bbox; + fz_irect rbox; + fz_bound_page(doc, page, &bbox); // Create a display list that will hold the drawing // commands for the page. @@ -191,7 +193,7 @@ int main(int argc, char **argv) // to populate the page's display list. fz_device *dev = fz_new_list_device(ctx, list); - fz_run_page(doc, page, dev, fz_identity, NULL); + fz_run_page(doc, page, dev, &fz_identity, NULL); fz_free_device(dev); // The page is no longer needed, all drawing commands @@ -201,7 +203,7 @@ int main(int argc, char **argv) // Create a white pixmap using the correct dimensions. - fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, fz_round_rect(bbox)); + fz_pixmap *pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, fz_round_rect(&rbox, &bbox)); fz_clear_pixmap_with_value(ctx, pix, 0xff); // Populate the data structure to be sent to the -- cgit v1.2.3