From 9f8e0724789744d81c5de0138e65284a9560e707 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 26 Feb 2018 16:31:06 +0100 Subject: 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). --- source/pdf/pdf-annot.c | 28 ++++++---------------------- 1 file changed, 6 insertions(+), 22 deletions(-) (limited to 'source/pdf/pdf-annot.c') 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; } -- cgit v1.2.3