diff options
author | Tor Andersson <tor@ghostscript.com> | 2010-04-08 19:54:33 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2010-04-08 19:54:33 +0200 |
commit | 28bb08951bea16b4baf3b05365d606fde0a099b6 (patch) | |
tree | 1b33a686f5e6d099d58fad96da808ebc2541bc58 /fitz/dev_null.c | |
parent | e32122e047e5882f3ca64d86cc0562473360b329 (diff) | |
download | mupdf-28bb08951bea16b4baf3b05365d606fde0a099b6.tar.xz |
Add display list device.
Diffstat (limited to 'fitz/dev_null.c')
-rw-r--r-- | fitz/dev_null.c | 43 |
1 files changed, 27 insertions, 16 deletions
diff --git a/fitz/dev_null.c b/fitz/dev_null.c index 4ad2e815..06d149ac 100644 --- a/fitz/dev_null.c +++ b/fitz/dev_null.c @@ -1,24 +1,27 @@ #include "fitz.h" -void fz_nullfillpath(void *user, fz_path *path, fz_colorspace *colorspace, float *color, float alpha) {} -void fz_nullstrokepath(void *user, fz_path *path, fz_colorspace *colorspace, float *color, float alpha) {} -void fz_nullclippath(void *user, fz_path *path) {} -void fz_nullfilltext(void *user, fz_text *text, fz_colorspace *colorspace, float *color, float alpha) {} -void fz_nullstroketext(void *user, fz_text *text, fz_colorspace *colorspace, float *color, float alpha) {} -void fz_nullcliptext(void *user, fz_text *text) {} -void fz_nullignoretext(void *user, fz_text *text) {} -void fz_nullpopclip(void *user) {} -void fz_nulldrawshade(void *user, fz_shade *shade, fz_matrix ctm) {} -void fz_nulldrawimage(void *user, fz_pixmap *image, fz_matrix ctm) {} -void fz_nullfillimagemask(void *user, fz_pixmap *image, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} -void fz_nullclipimagemask(void *user, fz_pixmap *image, fz_matrix ctm) {} - -fz_device *fz_newdevice(void *user) +static void fz_nullfreeuser(void *user) {} +static void fz_nullfillpath(void *user, fz_path *path, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} +static void fz_nullstrokepath(void *user, fz_path *path, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} +static void fz_nullclippath(void *user, fz_path *path, fz_matrix ctm) {} +static void fz_nullfilltext(void *user, fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} +static void fz_nullstroketext(void *user, fz_text *text, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} +static void fz_nullcliptext(void *user, fz_text *text, fz_matrix ctm) {} +static void fz_nullignoretext(void *user, fz_text *text, fz_matrix ctm) {} +static void fz_nullpopclip(void *user) {} +static void fz_nullfillshade(void *user, fz_shade *shade, fz_matrix ctm) {} +static void fz_nullfillimage(void *user, fz_pixmap *image, fz_matrix ctm) {} +static void fz_nullfillimagemask(void *user, fz_pixmap *image, fz_matrix ctm, fz_colorspace *colorspace, float *color, float alpha) {} +static void fz_nullclipimagemask(void *user, fz_pixmap *image, fz_matrix ctm) {} + +fz_device * +fz_newdevice(void *user) { fz_device *dev = fz_malloc(sizeof(fz_device)); memset(dev, 0, sizeof(fz_device)); dev->user = user; + dev->freeuser = fz_nullfreeuser; dev->fillpath = fz_nullfillpath; dev->strokepath = fz_nullstrokepath; @@ -29,12 +32,20 @@ fz_device *fz_newdevice(void *user) dev->cliptext = fz_nullcliptext; dev->ignoretext = fz_nullignoretext; + dev->fillshade = fz_nullfillshade; + dev->fillimage = fz_nullfillimage; dev->fillimagemask = fz_nullfillimagemask; dev->clipimagemask = fz_nullclipimagemask; - dev->drawimage = fz_nulldrawimage; - dev->drawshade = fz_nulldrawshade; dev->popclip = fz_nullpopclip; return dev; } + +void +fz_freedevice(fz_device *dev) +{ + if (dev->freeuser) + dev->freeuser(dev->user); + fz_free(dev); +}
\ No newline at end of file |