summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2013-02-13 13:58:21 +0100
committerTor Andersson <tor.andersson@artifex.com>2013-02-13 13:58:21 +0100
commit6c68b2e4e2ae93ca814129a6b1a03ab57a32ce7c (patch)
tree2d7de893aa48f4d65a93e593b615df9501cdc558 /doc
parentde1ccbf74a1061af9b4462eaef84510d6030775d (diff)
downloadmupdf-6c68b2e4e2ae93ca814129a6b1a03ab57a32ce7c.tar.xz
Update doc/multi-threaded.c for passing rect/matrix by reference.
Diffstat (limited to 'doc')
-rw-r--r--doc/multi-threaded.c10
1 files changed, 6 insertions, 4 deletions
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