diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2012-02-03 16:04:03 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2012-02-03 16:04:03 +0100 |
commit | f262a8c0bfae0cd90c2cd29acd409baf2157c241 (patch) | |
tree | 1a9f3a8c483e16c5d3d435d7c7143a6aa73b58e1 | |
parent | 139d80bd65a164accf9d36d244d3d6a4c555aa47 (diff) | |
download | mupdf-f262a8c0bfae0cd90c2cd29acd409baf2157c241.tar.xz |
Be consistent about passing a fz_context in path/text/shade functions.
-rw-r--r-- | apps/mupdfdraw.c | 4 | ||||
-rw-r--r-- | apps/muxpsdraw.c | 4 | ||||
-rw-r--r-- | draw/draw_device.c | 2 | ||||
-rw-r--r-- | draw/draw_glyph.c | 2 | ||||
-rw-r--r-- | fitz/dev_bbox.c | 6 | ||||
-rw-r--r-- | fitz/dev_list.c | 10 | ||||
-rw-r--r-- | fitz/dev_text.c | 6 | ||||
-rw-r--r-- | fitz/dev_trace.c | 10 | ||||
-rw-r--r-- | fitz/doc_outline.c | 8 | ||||
-rw-r--r-- | fitz/fitz.h | 31 | ||||
-rw-r--r-- | fitz/res_font.c | 11 | ||||
-rw-r--r-- | fitz/res_path.c | 6 | ||||
-rw-r--r-- | fitz/res_shade.c | 4 | ||||
-rw-r--r-- | fitz/res_text.c | 6 | ||||
-rw-r--r-- | pdf/pdf_interpret.c | 9 | ||||
-rw-r--r-- | pdf/pdf_type3.c | 2 | ||||
-rw-r--r-- | xps/xps_glyphs.c | 4 | ||||
-rw-r--r-- | xps/xps_path.c | 8 |
18 files changed, 66 insertions, 67 deletions
diff --git a/apps/mupdfdraw.c b/apps/mupdfdraw.c index e12a21b1..c4906237 100644 --- a/apps/mupdfdraw.c +++ b/apps/mupdfdraw.c @@ -351,9 +351,9 @@ static void drawoutline(pdf_document *doc) { fz_outline *outline = pdf_load_outline(doc); if (showoutline > 1) - fz_debug_outline_xml(outline, 0); + fz_debug_outline_xml(doc->ctx, outline, 0); else - fz_debug_outline(outline, 0); + fz_debug_outline(doc->ctx, outline, 0); fz_free_outline(doc->ctx, outline); } diff --git a/apps/muxpsdraw.c b/apps/muxpsdraw.c index 06270b71..bb7c986c 100644 --- a/apps/muxpsdraw.c +++ b/apps/muxpsdraw.c @@ -257,9 +257,9 @@ static void drawoutline(xps_document *doc) { fz_outline *outline = xps_load_outline(doc); if (showoutline > 1) - fz_debug_outline_xml(outline, 0); + fz_debug_outline_xml(doc->ctx, outline, 0); else - fz_debug_outline(outline, 0); + fz_debug_outline(doc->ctx, outline, 0); fz_free_outline(doc->ctx, outline); } diff --git a/draw/draw_device.c b/draw/draw_device.c index fa97ad1e..e3ddc09e 100644 --- a/draw/draw_device.c +++ b/draw/draw_device.c @@ -741,7 +741,7 @@ fz_draw_fill_shade(fz_device *devp, fz_shade *shade, fz_matrix ctm, float alpha) fz_draw_state *state = &dev->stack[dev->top]; fz_colorspace *model = state->dest->colorspace; - bounds = fz_bound_shade(shade, ctm); + bounds = fz_bound_shade(dev->ctx, shade, ctm); scissor = state->scissor; bbox = fz_intersect_bbox(fz_round_rect(bounds), scissor); diff --git a/draw/draw_glyph.c b/draw/draw_glyph.c index d7704a57..49f04fe8 100644 --- a/draw/draw_glyph.c +++ b/draw/draw_glyph.c @@ -143,7 +143,7 @@ fz_render_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix ctm, fz_color fz_try(ctx) { fz_hash_insert(ctx, cache->hash, &key, val); - fz_keep_font(key.font); + fz_keep_font(ctx, key.font); val = fz_keep_pixmap(ctx, val); } fz_catch(ctx) diff --git a/fitz/dev_bbox.c b/fitz/dev_bbox.c index 9165407f..636ceb94 100644 --- a/fitz/dev_bbox.c +++ b/fitz/dev_bbox.c @@ -7,7 +7,7 @@ fz_bbox_fill_path(fz_device *dev, fz_path *path, int even_odd, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) { fz_bbox *result = dev->user; - fz_bbox bbox = fz_round_rect(fz_bound_path(path, NULL, ctm)); + fz_bbox bbox = fz_round_rect(fz_bound_path(dev->ctx, path, NULL, ctm)); *result = fz_union_bbox(*result, bbox); } @@ -16,7 +16,7 @@ fz_bbox_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, fz_m fz_colorspace *colorspace, float *color, float alpha) { fz_bbox *result = dev->user; - fz_bbox bbox = fz_round_rect(fz_bound_path(path, stroke, ctm)); + fz_bbox bbox = fz_round_rect(fz_bound_path(dev->ctx, path, stroke, ctm)); *result = fz_union_bbox(*result, bbox); } @@ -42,7 +42,7 @@ static void fz_bbox_fill_shade(fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha) { fz_bbox *result = dev->user; - fz_bbox bbox = fz_round_rect(fz_bound_shade(shade, ctm)); + fz_bbox bbox = fz_round_rect(fz_bound_shade(dev->ctx, shade, ctm)); *result = fz_union_bbox(*result, bbox); } diff --git a/fitz/dev_list.c b/fitz/dev_list.c index 7f36ce88..873d6d71 100644 --- a/fitz/dev_list.c +++ b/fitz/dev_list.c @@ -234,7 +234,7 @@ fz_list_fill_path(fz_device *dev, fz_path *path, int even_odd, fz_matrix ctm, node = fz_new_display_node(ctx, FZ_CMD_FILL_PATH, ctm, colorspace, color, alpha); fz_try(ctx) { - node->rect = fz_bound_path(path, NULL, ctm); + node->rect = fz_bound_path(dev->ctx, path, NULL, ctm); node->item.path = fz_clone_path(dev->ctx, path); node->flag = even_odd; } @@ -255,7 +255,7 @@ fz_list_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, fz_m node = fz_new_display_node(ctx, FZ_CMD_STROKE_PATH, ctm, colorspace, color, alpha); fz_try(ctx) { - node->rect = fz_bound_path(path, stroke, ctm); + node->rect = fz_bound_path(dev->ctx, path, stroke, ctm); node->item.path = fz_clone_path(dev->ctx, path); node->stroke = fz_clone_stroke_state(dev->ctx, stroke); } @@ -275,7 +275,7 @@ fz_list_clip_path(fz_device *dev, fz_path *path, fz_rect *rect, int even_odd, fz node = fz_new_display_node(ctx, FZ_CMD_CLIP_PATH, ctm, NULL, NULL, 0); fz_try(ctx) { - node->rect = fz_bound_path(path, NULL, ctm); + node->rect = fz_bound_path(dev->ctx, path, NULL, ctm); if (rect) node->rect = fz_intersect_rect(node->rect, *rect); node->item.path = fz_clone_path(dev->ctx, path); @@ -297,7 +297,7 @@ fz_list_clip_stroke_path(fz_device *dev, fz_path *path, fz_rect *rect, fz_stroke node = fz_new_display_node(ctx, FZ_CMD_CLIP_STROKE_PATH, ctm, NULL, NULL, 0); fz_try(ctx) { - node->rect = fz_bound_path(path, stroke, ctm); + node->rect = fz_bound_path(dev->ctx, path, stroke, ctm); if (rect) node->rect = fz_intersect_rect(node->rect, *rect); node->item.path = fz_clone_path(dev->ctx, path); @@ -429,7 +429,7 @@ fz_list_fill_shade(fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha) fz_display_node *node; fz_context *ctx = dev->ctx; node = fz_new_display_node(ctx, FZ_CMD_FILL_SHADE, ctm, NULL, NULL, alpha); - node->rect = fz_bound_shade(shade, ctm); + node->rect = fz_bound_shade(ctx, shade, ctm); node->item.shade = fz_keep_shade(ctx, shade); fz_append_display_node(dev->user, node); } diff --git a/fitz/dev_text.c b/fitz/dev_text.c index d5b6ccf7..f7b55c5e 100644 --- a/fitz/dev_text.c +++ b/fitz/dev_text.c @@ -78,14 +78,14 @@ fz_add_text_char(fz_context *ctx, fz_text_span **last, fz_font *font, float size if (!span->font) { - span->font = fz_keep_font(font); + span->font = fz_keep_font(ctx, font); span->size = size; } if ((span->font != font || span->size != size || span->wmode != wmode) && c != 32) { span = fz_new_text_span(ctx); - span->font = fz_keep_font(font); + span->font = fz_keep_font(ctx, font); span->size = size; span->wmode = wmode; (*last)->next = span; @@ -145,7 +145,7 @@ fz_add_text_newline(fz_context *ctx, fz_text_span **last, fz_font *font, float s { fz_text_span *span; span = fz_new_text_span(ctx); - span->font = fz_keep_font(font); + span->font = fz_keep_font(ctx, font); span->size = size; span->wmode = wmode; (*last)->eol = 1; diff --git a/fitz/dev_trace.c b/fitz/dev_trace.c index 73449ad1..1c2e1ed1 100644 --- a/fitz/dev_trace.c +++ b/fitz/dev_trace.c @@ -145,7 +145,7 @@ fz_trace_fill_text(fz_device *dev, fz_text *text, fz_matrix ctm, fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(text, 0); + fz_debug_text(dev->ctx, text, 0); printf("</fill_text>\n"); } @@ -158,7 +158,7 @@ fz_trace_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_ fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(text, 0); + fz_debug_text(dev->ctx, text, 0); printf("</stroke_text>\n"); } @@ -170,7 +170,7 @@ fz_trace_clip_text(fz_device *dev, fz_text *text, fz_matrix ctm, int accumulate) fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(text, 0); + fz_debug_text(dev->ctx, text, 0); printf("</clip_text>\n"); } @@ -181,7 +181,7 @@ fz_trace_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(text, 0); + fz_debug_text(dev->ctx, text, 0); printf("</clip_stroke_text>\n"); } @@ -192,7 +192,7 @@ fz_trace_ignore_text(fz_device *dev, fz_text *text, fz_matrix ctm) fz_trace_matrix(ctm); fz_trace_trm(text->trm); printf(">\n"); - fz_debug_text(text, 0); + fz_debug_text(dev->ctx, text, 0); printf("</ignore_text>\n"); } diff --git a/fitz/doc_outline.c b/fitz/doc_outline.c index fc50b57f..b69debaf 100644 --- a/fitz/doc_outline.c +++ b/fitz/doc_outline.c @@ -15,7 +15,7 @@ fz_free_outline(fz_context *ctx, fz_outline *outline) } void -fz_debug_outline_xml(fz_outline *outline, int level) +fz_debug_outline_xml(fz_context *ctx, fz_outline *outline, int level) { while (outline) { @@ -23,7 +23,7 @@ fz_debug_outline_xml(fz_outline *outline, int level) if (outline->down) { printf(">\n"); - fz_debug_outline_xml(outline->down, level + 1); + fz_debug_outline_xml(ctx, outline->down, level + 1); printf("</outline>\n"); } else @@ -35,7 +35,7 @@ fz_debug_outline_xml(fz_outline *outline, int level) } void -fz_debug_outline(fz_outline *outline, int level) +fz_debug_outline(fz_context *ctx, fz_outline *outline, int level) { int i; while (outline) @@ -44,7 +44,7 @@ fz_debug_outline(fz_outline *outline, int level) putchar('\t'); printf("%s\t%d\n", outline->title, outline->dest.kind == FZ_LINK_GOTO ? outline->dest.ld.gotor.page + 1 : 0); if (outline->down) - fz_debug_outline(outline->down, level + 1); + fz_debug_outline(ctx, outline->down, level + 1); outline = outline->next; } } diff --git a/fitz/fitz.h b/fitz/fitz.h index 997e5658..8aa97004 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -1047,7 +1047,7 @@ fz_colorspace *fz_find_device_colorspace(char *name); * Type 3 fonts have callbacks to the interpreter. */ -struct fz_device_s; +typedef struct fz_device_s fz_device; typedef struct fz_font_s fz_font; char *ft_error_string(int err); @@ -1074,8 +1074,7 @@ struct fz_font_s float *t3widths; /* has 256 entries if used */ char *t3flags; /* has 256 entries if used */ void *t3doc; /* a pdf_document for the callback */ - void (*t3run)(void *doc, fz_obj *resources, fz_buffer *contents, - struct fz_device_s *dev, fz_matrix ctm, void *gstate); + void (*t3run)(void *doc, fz_obj *resources, fz_buffer *contents, fz_device *dev, fz_matrix ctm, void *gstate); fz_rect bbox; /* font bbox is used only for t3 fonts */ @@ -1097,14 +1096,14 @@ fz_font *fz_new_type3_font(fz_context *ctx, char *name, fz_matrix matrix); fz_font *fz_new_font_from_memory(fz_context *ctx, unsigned char *data, int len, int index, int use_glyph_bbox); fz_font *fz_new_font_from_file(fz_context *ctx, char *path, int index, int use_glyph_bbox); -fz_font *fz_keep_font(fz_font *font); +fz_font *fz_keep_font(fz_context *ctx, fz_font *font); void fz_drop_font(fz_context *ctx, fz_font *font); -void fz_debug_font(fz_font *font); +void fz_debug_font(fz_context *ctx, fz_font *font); -void fz_set_font_bbox(fz_font *font, float xmin, float ymin, float xmax, float ymax); +void fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax); fz_rect fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm); -int fz_glyph_cacheable(fz_font *font, int gid); +int fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid); /* * Vector path buffer. @@ -1177,19 +1176,17 @@ void fz_curvetoy(fz_context*,fz_path*, float, float, float, float); void fz_closepath(fz_context*,fz_path*); void fz_free_path(fz_context *ctx, fz_path *path); -void fz_transform_path(fz_path *path, fz_matrix transform); +void fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix transform); fz_path *fz_clone_path(fz_context *ctx, fz_path *old); -fz_rect fz_bound_path(fz_path *path, fz_stroke_state *stroke, fz_matrix ctm); -void fz_debug_path(fz_path *, int indent); +fz_rect fz_bound_path(fz_context *ctx, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm); +void fz_debug_path(fz_context *ctx, fz_path *, int indent); /* * Glyph cache */ -typedef struct fz_device_s fz_device; - void fz_new_glyph_cache_context(fz_context *ctx); void fz_free_glyph_cache_context(fz_context *ctx); @@ -1236,7 +1233,7 @@ void fz_add_text(fz_context *ctx, fz_text *text, int gid, int ucs, float x, floa void fz_free_text(fz_context *ctx, fz_text *text); fz_rect fz_bound_text(fz_context *ctx, fz_text *text, fz_matrix ctm); fz_text *fz_clone_text(fz_context *ctx, fz_text *old); -void fz_debug_text(fz_text*, int indent); +void fz_debug_text(fz_context *ctx, fz_text*, int indent); /* * The shading code uses gouraud shaded triangle meshes. @@ -1276,9 +1273,9 @@ struct fz_shade_s fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade); void fz_drop_shade(fz_context *ctx, fz_shade *shade); void fz_free_shade_imp(fz_context *ctx, fz_storable *shade); -void fz_debug_shade(fz_shade *shade); +void fz_debug_shade(fz_context *ctx, fz_shade *shade); -fz_rect fz_bound_shade(fz_shade *shade, fz_matrix ctm); +fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm); void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_pixmap *dest, fz_bbox bbox); /* @@ -1593,8 +1590,8 @@ struct fz_outline_s fz_outline *down; }; -void fz_debug_outline_xml(fz_outline *outline, int level); -void fz_debug_outline(fz_outline *outline, int level); +void fz_debug_outline_xml(fz_context *ctx, fz_outline *outline, int level); +void fz_debug_outline(fz_context *ctx, fz_outline *outline, int level); void fz_free_outline(fz_context *ctx, fz_outline *outline); /* Document interface */ diff --git a/fitz/res_font.c b/fitz/res_font.c index 47dc96d5..f8dcfb90 100644 --- a/fitz/res_font.c +++ b/fitz/res_font.c @@ -68,9 +68,10 @@ fz_new_font(fz_context *ctx, char *name, int use_glyph_bbox, int glyph_count) } fz_font * -fz_keep_font(fz_font *font) +fz_keep_font(fz_context *ctx, fz_font *font) { - font->refs ++; + if (font) + font->refs ++; return font; } @@ -111,7 +112,7 @@ fz_drop_font(fz_context *ctx, fz_font *font) } void -fz_set_font_bbox(fz_font *font, float xmin, float ymin, float xmax, float ymax) +fz_set_font_bbox(fz_context *ctx, fz_font *font, float xmin, float ymin, float xmax, float ymax) { font->bbox.x0 = xmin; font->bbox.y0 = ymin; @@ -749,7 +750,7 @@ fz_render_t3_glyph_direct(fz_context *ctx, fz_device *dev, fz_font *font, int gi } void -fz_debug_font(fz_font *font) +fz_debug_font(fz_context *ctx, fz_font *font) { printf("font '%s' {\n", font->name); @@ -795,7 +796,7 @@ fz_bound_glyph(fz_context *ctx, fz_font *font, int gid, fz_matrix trm) return fz_transform_rect(trm, font->bbox); } -int fz_glyph_cacheable(fz_font *font, int gid) +int fz_glyph_cacheable(fz_context *ctx, fz_font *font, int gid) { if (!font->t3procs || !font->t3flags || gid < 0 || gid >= font->bbox_count) return 1; diff --git a/fitz/res_path.c b/fitz/res_path.c index 64452a28..a645f9d5 100644 --- a/fitz/res_path.c +++ b/fitz/res_path.c @@ -219,7 +219,7 @@ static inline fz_rect bound_expand(fz_rect r, fz_point p) } fz_rect -fz_bound_path(fz_path *path, fz_stroke_state *stroke, fz_matrix ctm) +fz_bound_path(fz_context *ctx, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm) { fz_point p; fz_rect r; @@ -280,7 +280,7 @@ fz_bound_path(fz_path *path, fz_stroke_state *stroke, fz_matrix ctm) } void -fz_transform_path(fz_path *path, fz_matrix ctm) +fz_transform_path(fz_context *ctx, fz_path *path, fz_matrix ctm) { fz_point p; int k, i = 0; @@ -316,7 +316,7 @@ fz_transform_path(fz_path *path, fz_matrix ctm) } void -fz_debug_path(fz_path *path, int indent) +fz_debug_path(fz_context *ctx, fz_path *path, int indent) { float x, y; int i = 0; diff --git a/fitz/res_shade.c b/fitz/res_shade.c index 34fba64d..3fdf2e15 100644 --- a/fitz/res_shade.c +++ b/fitz/res_shade.c @@ -24,7 +24,7 @@ fz_drop_shade(fz_context *ctx, fz_shade *shade) } fz_rect -fz_bound_shade(fz_shade *shade, fz_matrix ctm) +fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm) { float *v; fz_rect r, s; @@ -68,7 +68,7 @@ fz_bound_shade(fz_shade *shade, fz_matrix ctm) } void -fz_debug_shade(fz_shade *shade) +fz_debug_shade(fz_context *ctx, fz_shade *shade) { int i, j, n; float *vertex; diff --git a/fitz/res_text.c b/fitz/res_text.c index cc43b261..cdfaaa98 100644 --- a/fitz/res_text.c +++ b/fitz/res_text.c @@ -6,7 +6,7 @@ fz_new_text(fz_context *ctx, fz_font *font, fz_matrix trm, int wmode) fz_text *text; text = fz_malloc_struct(ctx, fz_text); - text->font = fz_keep_font(font); + text->font = fz_keep_font(ctx, font); text->trm = trm; text->wmode = wmode; text->len = 0; @@ -44,7 +44,7 @@ fz_clone_text(fz_context *ctx, fz_text *old) fz_rethrow(ctx); } memcpy(text->items, old->items, text->len * sizeof(fz_text_item)); - text->font = fz_keep_font(old->font); + text->font = fz_keep_font(ctx, old->font); text->trm = old->trm; text->wmode = old->wmode; text->cap = text->len; @@ -123,7 +123,7 @@ static int isxmlmeta(int c) return c < 32 || c >= 128 || c == '&' || c == '<' || c == '>' || c == '\'' || c == '"'; } -void fz_debug_text(fz_text *text, int indent) +void fz_debug_text(fz_context *ctx, fz_text *text, int indent) { int i, n; for (i = 0; i < text->len; i++) diff --git a/pdf/pdf_interpret.c b/pdf/pdf_interpret.c index cdab98a1..3a32b693 100644 --- a/pdf/pdf_interpret.c +++ b/pdf/pdf_interpret.c @@ -345,13 +345,14 @@ pdf_end_group(pdf_csi *csi) static void pdf_show_shade(pdf_csi *csi, fz_shade *shd) { + fz_context *ctx = csi->dev->ctx; pdf_gstate *gstate = csi->gstate + csi->gtop; fz_rect bbox; if (csi->in_hidden_ocg > 0) return; - bbox = fz_bound_shade(shd, gstate->ctm); + bbox = fz_bound_shade(ctx, shd, gstate->ctm); pdf_begin_group(csi, bbox); @@ -460,9 +461,9 @@ pdf_show_path(pdf_csi *csi, int doclose, int dofill, int dostroke, int even_odd) fz_closepath(ctx, path); if (dostroke) - bbox = fz_bound_path(path, &gstate->stroke_state, gstate->ctm); + bbox = fz_bound_path(ctx, path, &gstate->stroke_state, gstate->ctm); else - bbox = fz_bound_path(path, NULL, gstate->ctm); + bbox = fz_bound_path(ctx, path, NULL, gstate->ctm); if (csi->clip) { @@ -722,7 +723,7 @@ pdf_show_char(pdf_csi *csi, int cid) bbox.x1 += 1; bbox.y1 += 1; - render_direct = !fz_glyph_cacheable(fontdesc->font, gid); + render_direct = !fz_glyph_cacheable(ctx, fontdesc->font, gid); /* flush buffered text if face or matrix or rendermode has changed */ if (!csi->text || diff --git a/pdf/pdf_type3.c b/pdf/pdf_type3.c index 176bf32a..3b596cdd 100644 --- a/pdf/pdf_type3.c +++ b/pdf/pdf_type3.c @@ -45,7 +45,7 @@ pdf_load_type3_font(pdf_document *xref, fz_obj *rdb, fz_obj *dict) fontdesc->font = fz_new_type3_font(ctx, buf, matrix); fontdesc->size += sizeof(fz_font) + 256 * (sizeof(fz_buffer*) + sizeof(float)); - fz_set_font_bbox(fontdesc->font, bbox.x0, bbox.y0, bbox.x1, bbox.y1); + fz_set_font_bbox(ctx, fontdesc->font, bbox.x0, bbox.y0, bbox.x1, bbox.y1); /* Encoding */ diff --git a/xps/xps_glyphs.c b/xps/xps_glyphs.c index c394dd18..dc85f0ae 100644 --- a/xps/xps_glyphs.c +++ b/xps/xps_glyphs.c @@ -74,7 +74,7 @@ xps_lookup_font(xps_document *doc, char *name) xps_font_cache *cache; for (cache = doc->font_table; cache; cache = cache->next) if (!xps_strcasecmp(cache->name, name)) - return fz_keep_font(cache->font); + return fz_keep_font(doc->ctx, cache->font); return NULL; } @@ -83,7 +83,7 @@ xps_insert_font(xps_document *doc, char *name, fz_font *font) { xps_font_cache *cache = fz_malloc_struct(doc->ctx, xps_font_cache); cache->name = fz_strdup(doc->ctx, name); - cache->font = fz_keep_font(font); + cache->font = fz_keep_font(doc->ctx, font); cache->next = doc->font_table; doc->font_table = cache; } diff --git a/xps/xps_path.c b/xps/xps_path.c index 77bb6a36..76b9bb21 100644 --- a/xps/xps_path.c +++ b/xps/xps_path.c @@ -763,7 +763,7 @@ xps_parse_path_geometry(xps_document *doc, xps_resource *dict, xml_element *root } if (transform_att || transform_tag) - fz_transform_path(path, transform); + fz_transform_path(doc->ctx, path, transform); return path; } @@ -974,9 +974,9 @@ xps_parse_path(xps_document *doc, fz_matrix ctm, char *base_uri, xps_resource *d path = xps_parse_path_geometry(doc, dict, data_tag, 0, &fill_rule); if (stroke_att || stroke_tag) - area = fz_bound_path(path, &stroke, ctm); + area = fz_bound_path(doc->ctx, path, &stroke, ctm); else - area = fz_bound_path(path, NULL, ctm); + area = fz_bound_path(doc->ctx, path, NULL, ctm); if (navigate_uri_att) xps_add_link(doc, area, base_uri, navigate_uri_att); @@ -996,7 +996,7 @@ xps_parse_path(xps_document *doc, fz_matrix ctm, char *base_uri, xps_resource *d if (fill_tag) { - area = fz_bound_path(path, NULL, ctm); + area = fz_bound_path(doc->ctx, path, NULL, ctm); fz_clip_path(doc->dev, path, NULL, fill_rule == 0, ctm); xps_parse_brush(doc, ctm, area, fill_uri, dict, fill_tag); |