diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/mupdf/fitz/context.h | 30 | ||||
-rw-r--r-- | include/mupdf/fitz/path.h | 2 |
2 files changed, 32 insertions, 0 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h index f694bc39..e58e5f61 100644 --- a/include/mupdf/fitz/context.h +++ b/include/mupdf/fitz/context.h @@ -470,6 +470,19 @@ fz_keep_imp(fz_context *ctx, void *p, int *refs) return p; } +static inline void * +fz_keep_imp8(fz_context *ctx, void *p, int8_t *refs) +{ + if (p) + { + fz_lock(ctx, FZ_LOCK_ALLOC); + if (*refs > 0) + ++*refs; + fz_unlock(ctx, FZ_LOCK_ALLOC); + } + return p; +} + static inline int fz_drop_imp(fz_context *ctx, void *p, int *refs) { @@ -487,4 +500,21 @@ fz_drop_imp(fz_context *ctx, void *p, int *refs) return 0; } +static inline int +fz_drop_imp8(fz_context *ctx, void *p, int8_t *refs) +{ + if (p) + { + int drop; + fz_lock(ctx, FZ_LOCK_ALLOC); + if (*refs > 0) + drop = --*refs == 0; + else + drop = 0; + fz_unlock(ctx, FZ_LOCK_ALLOC); + return drop; + } + return 0; +} + #endif diff --git a/include/mupdf/fitz/path.h b/include/mupdf/fitz/path.h index 1bca1858..81b6f7bb 100644 --- a/include/mupdf/fitz/path.h +++ b/include/mupdf/fitz/path.h @@ -64,6 +64,8 @@ fz_path *fz_new_path(fz_context *ctx); fz_path *fz_keep_path(fz_context *ctx, fz_path *path); void fz_drop_path(fz_context *ctx, fz_path *path); void fz_trim_path(fz_context *ctx, fz_path *path); +int fz_packed_path_size(const fz_path *path); +int fz_pack_path(fz_context *ctx, uint8_t *pack, int max, const fz_path *path); fz_point fz_currentpoint(fz_context *ctx, fz_path *path); void fz_moveto(fz_context*, fz_path*, float x, float y); |