diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-11-02 14:02:02 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-11-02 14:02:46 +0100 |
commit | 858ac10caae93ffad55ae0b8bdc8189924504bc8 (patch) | |
tree | 7d4201fc7d002a5d22d14b20bd79948623bfd757 /platform | |
parent | 3a0cd035010aea567ba07755a76a7a2e94c96aa4 (diff) | |
download | mupdf-858ac10caae93ffad55ae0b8bdc8189924504bc8.tar.xz |
android: Don't bound twice in update_changed_rects.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/android/viewer/jni/mupdf.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/platform/android/viewer/jni/mupdf.c b/platform/android/viewer/jni/mupdf.c index c50d5a89..aa14a8f6 100644 --- a/platform/android/viewer/jni/mupdf.c +++ b/platform/android/viewer/jni/mupdf.c @@ -678,15 +678,18 @@ static void update_changed_rects(globals *glo, page_cache *pc, pdf_document *ido if (pannot->changed) { fz_annot *annot = (fz_annot*)pannot; + fz_rect bounds; + rect_node *node; - /* FIXME: We bound the annot twice here */ - rect_node *node = fz_malloc_struct(ctx, rect_node); - fz_bound_annot(ctx, annot, &node->rect); + fz_bound_annot(ctx, annot, &bounds); + + node = fz_malloc_struct(ctx, rect_node); + node->rect = bounds; node->next = pc->changed_rects; pc->changed_rects = node; node = fz_malloc_struct(ctx, rect_node); - fz_bound_annot(ctx, annot, &node->rect); + node->rect = bounds; node->next = pc->hq_changed_rects; pc->hq_changed_rects = node; @@ -699,18 +702,21 @@ static void update_changed_rects_all_page(globals *glo, page_cache *pc, pdf_docu { fz_context *ctx = glo->ctx; fz_page *page = pc->page; + fz_rect bounds; rect_node *node; + fz_bound_page(ctx, page, &node->rect); + drop_changed_rects(ctx, &pc->hq_changed_rects); drop_changed_rects(ctx, &pc->changed_rects); node = fz_malloc_struct(ctx, rect_node); - fz_bound_page(ctx, page, &node->rect); + node->rect = bounds; node->next = pc->changed_rects; pc->changed_rects = node; node = fz_malloc_struct(ctx, rect_node); - fz_bound_page(ctx, page, &node->rect); + node->rect = bounds; node->next = pc->hq_changed_rects; pc->hq_changed_rects = node; } |