diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-26 16:31:06 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-02-27 17:47:54 +0100 |
commit | 9f8e0724789744d81c5de0138e65284a9560e707 (patch) | |
tree | ac4237044423e8ac6bf60a33a879862134c3f8bb /source/pdf/pdf-annot.c | |
parent | 8ebca3d5481961f56b5754ab4cfa9544f58c5b0b (diff) | |
download | mupdf-9f8e0724789744d81c5de0138e65284a9560e707.tar.xz |
Remove pdf_xobject wrapper struct.
Just use the pdf_obj directly.
Revise ap_iteration and split annot->dirty into separate flags.
One flag for needs_new_ap, and one for has_new_ap (to be used by
clients who may have cached a rendered annotation).
Diffstat (limited to 'source/pdf/pdf-annot.c')
-rw-r--r-- | source/pdf/pdf-annot.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c index 7046ff18..3325c828 100644 --- a/source/pdf/pdf-annot.c +++ b/source/pdf/pdf-annot.c @@ -358,7 +358,7 @@ pdf_resolve_link(fz_context *ctx, pdf_document *doc, const char *uri, float *xp, static void pdf_drop_annot_imp(fz_context *ctx, pdf_annot *annot) { - pdf_drop_xobject(ctx, annot->ap); + pdf_drop_obj(ctx, annot->ap); pdf_drop_obj(ctx, annot->obj); } @@ -496,11 +496,11 @@ pdf_load_annots(fz_context *ctx, pdf_page *page, pdf_obj *annots) n = pdf_dict_get(ctx, n, as); annot->ap = NULL; + annot->has_new_ap = 1; if (pdf_is_stream(ctx, n)) { - annot->ap = pdf_load_xobject(ctx, doc, n); - annot->ap_iteration = annot->ap->iteration; + annot->ap = pdf_keep_obj(ctx, n); } else fz_warn(ctx, "no appearance stream for annotation %d 0 R", pdf_to_num(ctx, annot->obj)); @@ -561,23 +561,7 @@ pdf_bound_annot(fz_context *ctx, pdf_annot *annot, fz_rect *rect) void pdf_dirty_annot(fz_context *ctx, pdf_annot *annot) { - if (annot) - { - annot->dirty = 1; - if (annot->page && annot->page->doc) - annot->page->doc->dirty = 1; - } -} - -void -pdf_clean_annot(fz_context *ctx, pdf_annot *annot) -{ - if (annot) - annot->dirty = 0; -} - -int -pdf_annot_is_dirty(fz_context *ctx, pdf_annot *annot) -{ - return annot ? annot->dirty: 0; + annot->needs_new_ap = 1; + if (annot->page && annot->page->doc) + annot->page->doc->dirty = 1; } |