summaryrefslogtreecommitdiff
path: root/fitzdraw
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2009-03-11 22:07:53 +0100
committerTor Andersson <tor@ghostscript.com>2009-03-11 22:07:53 +0100
commit2e04ad6b587c9a34d18819165152ace7657cf443 (patch)
tree61fcaf8afa4509a38fd3deab41ad100ad6939cbe /fitzdraw
parent9f6a77c2d17128a44bf2fc9fead449a05354def5 (diff)
downloadmupdf-2e04ad6b587c9a34d18819165152ace7657cf443.tar.xz
Remove fz_outofmem constant.
Diffstat (limited to 'fitzdraw')
-rw-r--r--fitzdraw/glyphcache.c8
-rw-r--r--fitzdraw/imagescale.c10
-rw-r--r--fitzdraw/meshdraw.c2
-rw-r--r--fitzdraw/pathfill.c6
-rw-r--r--fitzdraw/pathscan.c24
-rw-r--r--fitzdraw/pathstroke.c32
-rw-r--r--fitzdraw/pixmap.c10
-rw-r--r--fitzdraw/render.c26
8 files changed, 59 insertions, 59 deletions
diff --git a/fitzdraw/glyphcache.c b/fitzdraw/glyphcache.c
index cc39f437..f3f6d38d 100644
--- a/fitzdraw/glyphcache.c
+++ b/fitzdraw/glyphcache.c
@@ -57,14 +57,14 @@ static unsigned int hashkey(fz_key *key)
return hash;
}
-fz_error
+fz_error
fz_newglyphcache(fz_glyphcache **arenap, int slots, int size)
{
fz_glyphcache *arena;
arena = *arenap = fz_malloc(sizeof(fz_glyphcache));
if (!arena)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
arena->slots = slots;
arena->size = size;
@@ -98,7 +98,7 @@ cleanup:
fz_free(arena->lru);
fz_free(arena->buffer);
fz_free(arena);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
void
@@ -313,7 +313,7 @@ evictall(fz_glyphcache *arena)
arena->used = 0;
}
-fz_error
+fz_error
fz_renderglyph(fz_glyphcache *arena, fz_glyph *glyph, fz_font *font, int cid, fz_matrix ctm)
{
fz_error error;
diff --git a/fitzdraw/imagescale.c b/fitzdraw/imagescale.c
index 065a250e..5d9af3ac 100644
--- a/fitzdraw/imagescale.c
+++ b/fitzdraw/imagescale.c
@@ -179,7 +179,7 @@ void (*fz_scol2)(byte *src, byte *dst, int w, int denom) = scol2;
void (*fz_scol4)(byte *src, byte *dst, int w, int denom) = scol4;
void (*fz_scol5)(byte *src, byte *dst, int w, int denom) = scol5;
-fz_error
+fz_error
fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom)
{
int ow = (w + xdenom - 1) / xdenom;
@@ -188,7 +188,7 @@ fz_newscaledpixmap(fz_pixmap **dstp, int w, int h, int n, int xdenom, int ydenom
}
/* TODO: refactor */
-fz_error
+fz_error
fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xdenom, int ydenom)
{
unsigned char *buf;
@@ -212,7 +212,7 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
buf = fz_malloc(ow * n * ydenom);
if (!buf)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
switch (n)
{
@@ -271,7 +271,7 @@ fz_scalepixmaptile(fz_pixmap *dst, int xoffs, int yoffs, fz_pixmap *src, int xde
return fz_okay;
}
-fz_error
+fz_error
fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
{
fz_error error;
@@ -290,7 +290,7 @@ fz_scalepixmap(fz_pixmap **dstp, fz_pixmap *src, int xdenom, int ydenom)
buf = fz_malloc(ow * n * ydenom);
if (!buf)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
error = fz_newpixmap(&dst, 0, 0, ow, oh, src->n);
if (error)
diff --git a/fitzdraw/meshdraw.c b/fitzdraw/meshdraw.c
index 2eedcbc2..ebaaaeaa 100644
--- a/fitzdraw/meshdraw.c
+++ b/fitzdraw/meshdraw.c
@@ -312,7 +312,7 @@ fz_drawtriangle(fz_pixmap *pix, float *av, float *bv, float *cv, int n)
* mesh drawing
*/
-fz_error
+fz_error
fz_rendershade(fz_shade *shade, fz_matrix ctm, fz_colorspace *destcs, fz_pixmap *dest)
{
unsigned char clut[256][3];
diff --git a/fitzdraw/pathfill.c b/fitzdraw/pathfill.c
index 92aff3b4..e74fd879 100644
--- a/fitzdraw/pathfill.c
+++ b/fitzdraw/pathfill.c
@@ -2,7 +2,7 @@
#include "fitz_tree.h"
#include "fitz_draw.h"
-static fz_error
+static fz_error
line(fz_gel *gel, fz_matrix *ctm, float x0, float y0, float x1, float y1)
{
float tx0 = ctm->a * x0 + ctm->c * y0 + ctm->e;
@@ -12,7 +12,7 @@ line(fz_gel *gel, fz_matrix *ctm, float x0, float y0, float x1, float y1)
return fz_insertgel(gel, tx0, ty0, tx1, ty1);
}
-static fz_error
+static fz_error
bezier(fz_gel *gel, fz_matrix *ctm, float flatness,
float xa, float ya,
float xb, float yb,
@@ -66,7 +66,7 @@ bezier(fz_gel *gel, fz_matrix *ctm, float flatness,
return bezier(gel, ctm, flatness, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error
+fz_error
fz_fillpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness)
{
fz_error error;
diff --git a/fitzdraw/pathscan.c b/fitzdraw/pathscan.c
index 2ab7d5b6..64397563 100644
--- a/fitzdraw/pathscan.c
+++ b/fitzdraw/pathscan.c
@@ -18,14 +18,14 @@ enum { HSCALE = 17, VSCALE = 15, SF = 1 };
* See Mike Abrash -- Graphics Programming Black Book (notably chapter 40)
*/
-fz_error
+fz_error
fz_newgel(fz_gel **gelp)
{
fz_gel *gel;
gel = *gelp = fz_malloc(sizeof(fz_gel));
if (!gel)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
gel->edges = nil;
@@ -34,7 +34,7 @@ fz_newgel(fz_gel **gelp)
gel->edges = fz_malloc(sizeof(fz_edge) * gel->cap);
if (!gel->edges) {
fz_free(gel);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
gel->clip.x0 = gel->clip.y0 = INT_MAX;
@@ -114,7 +114,7 @@ cliplerpx(int val, int m, int x0, int y0, int x1, int y1, int *out)
}
}
-fz_error
+fz_error
fz_insertgel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1)
{
fz_edge *edge;
@@ -163,7 +163,7 @@ fz_insertgel(fz_gel *gel, float fx0, float fy0, float fx1, float fy1)
int newcap = gel->cap + 512;
fz_edge *newedges = fz_realloc(gel->edges, sizeof(fz_edge) * newcap);
if (!newedges)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
gel->cap = newcap;
gel->edges = newedges;
}
@@ -243,21 +243,21 @@ fz_sortgel(fz_gel *gel)
* Active Edge List -- keep track of active edges while sweeping
*/
-fz_error
+fz_error
fz_newael(fz_ael **aelp)
{
fz_ael *ael;
ael = *aelp = fz_malloc(sizeof(fz_ael));
if (!ael)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
ael->cap = 64;
ael->len = 0;
ael->edges = fz_malloc(sizeof(fz_edge*) * ael->cap);
if (!ael->edges) {
fz_free(ael);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
return fz_okay;
@@ -303,7 +303,7 @@ sortael(fz_edge **a, int n)
}
}
-static fz_error
+static fz_error
insertael(fz_ael *ael, fz_gel *gel, int y, int *e)
{
/* insert edges that start here */
@@ -312,7 +312,7 @@ insertael(fz_ael *ael, fz_gel *gel, int y, int *e)
int newcap = ael->cap + 64;
fz_edge **newedges = fz_realloc(ael->edges, sizeof(fz_edge*) * newcap);
if (!newedges)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
ael->edges = newedges;
ael->cap = newcap;
}
@@ -458,7 +458,7 @@ static inline void blit(fz_pixmap *pix, int x, int y,
fz_path_1c1(list, cov, len, dst);
}
-fz_error
+fz_error
fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill, fz_irect clip,
fz_pixmap *pix, unsigned char *argb, int over)
{
@@ -483,7 +483,7 @@ fz_scanconvert(fz_gel *gel, fz_ael *ael, int eofill, fz_irect clip,
deltas = fz_malloc(xmax - xmin + 1);
if (!deltas)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
memset(deltas, 0, xmax - xmin + 1);
diff --git a/fitzdraw/pathstroke.c b/fitzdraw/pathstroke.c
index 7b560313..b597a425 100644
--- a/fitzdraw/pathstroke.c
+++ b/fitzdraw/pathstroke.c
@@ -26,7 +26,7 @@ struct sctx
fz_point cur;
};
-static fz_error
+static fz_error
line(struct sctx *s, float x0, float y0, float x1, float y1)
{
float tx0 = s->ctm->a * x0 + s->ctm->c * y0 + s->ctm->e;
@@ -36,7 +36,7 @@ line(struct sctx *s, float x0, float y0, float x1, float y1)
return fz_insertgel(s->gel, tx0, ty0, tx1, ty1);
}
-static fz_error
+static fz_error
arc(struct sctx *s,
float xc, float yc,
float x0, float y0,
@@ -85,7 +85,7 @@ arc(struct sctx *s,
return fz_okay;
}
-static fz_error
+static fz_error
linestroke(struct sctx *s, fz_point a, fz_point b)
{
fz_error error;
@@ -105,7 +105,7 @@ linestroke(struct sctx *s, fz_point a, fz_point b)
return fz_okay;
}
-static fz_error
+static fz_error
linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c)
{
fz_error error;
@@ -208,7 +208,7 @@ linejoin(struct sctx *s, fz_point a, fz_point b, fz_point c)
return fz_okay;
}
-static fz_error
+static fz_error
linecap(struct sctx *s, fz_point a, fz_point b)
{
fz_error error;
@@ -268,7 +268,7 @@ linecap(struct sctx *s, fz_point a, fz_point b)
return fz_okay;
}
-static fz_error
+static fz_error
linedot(struct sctx *s, fz_point a)
{
fz_error error;
@@ -295,7 +295,7 @@ linedot(struct sctx *s, fz_point a)
return fz_okay;
}
-static fz_error
+static fz_error
strokeflush(struct sctx *s)
{
fz_error error;
@@ -318,7 +318,7 @@ strokeflush(struct sctx *s)
return fz_okay;
}
-static fz_error
+static fz_error
strokemoveto(struct sctx *s, fz_point cur)
{
fz_error error;
@@ -334,7 +334,7 @@ strokemoveto(struct sctx *s, fz_point cur)
return fz_okay;
}
-static fz_error
+static fz_error
strokelineto(struct sctx *s, fz_point cur)
{
fz_error error;
@@ -368,7 +368,7 @@ strokelineto(struct sctx *s, fz_point cur)
return fz_okay;
}
-static fz_error
+static fz_error
strokeclosepath(struct sctx *s)
{
fz_error error;
@@ -398,7 +398,7 @@ strokeclosepath(struct sctx *s)
return fz_okay;
}
-static fz_error
+static fz_error
strokebezier(struct sctx *s,
float xa, float ya,
float xb, float yb,
@@ -457,7 +457,7 @@ strokebezier(struct sctx *s,
return strokebezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error
+fz_error
fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth)
{
fz_error error;
@@ -530,7 +530,7 @@ fz_strokepath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, flo
return strokeflush(&s);
}
-static fz_error
+static fz_error
dashmoveto(struct sctx *s, fz_point a)
{
s->toggle = 1;
@@ -554,7 +554,7 @@ dashmoveto(struct sctx *s, fz_point a)
return fz_okay;
}
-static fz_error
+static fz_error
dashlineto(struct sctx *s, fz_point b)
{
fz_error error;
@@ -600,7 +600,7 @@ dashlineto(struct sctx *s, fz_point b)
return fz_okay;
}
-static fz_error
+static fz_error
dashbezier(struct sctx *s,
float xa, float ya,
float xb, float yb,
@@ -657,7 +657,7 @@ dashbezier(struct sctx *s,
return dashbezier(s, xabcd, yabcd, xbcd, ybcd, xcd, ycd, xd, yd);
}
-fz_error
+fz_error
fz_dashpath(fz_gel *gel, fz_pathnode *path, fz_matrix ctm, float flatness, float linewidth)
{
fz_error error;
diff --git a/fitzdraw/pixmap.c b/fitzdraw/pixmap.c
index 2103f59b..e3d9a285 100644
--- a/fitzdraw/pixmap.c
+++ b/fitzdraw/pixmap.c
@@ -2,14 +2,14 @@
#include "fitz_tree.h"
#include "fitz_draw.h"
-fz_error
+fz_error
fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n)
{
fz_pixmap *pix;
pix = *pixp = fz_malloc(sizeof(fz_pixmap));
if (!pix)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
pix->x = x;
pix->y = y;
@@ -20,13 +20,13 @@ fz_newpixmap(fz_pixmap **pixp, int x, int y, int w, int h, int n)
pix->samples = fz_malloc(pix->w * pix->h * pix->n * sizeof(fz_sample));
if (!pix->samples) {
fz_free(pix);
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
}
return fz_okay;
}
-fz_error
+fz_error
fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n)
{
return fz_newpixmap(pixp,
@@ -35,7 +35,7 @@ fz_newpixmapwithrect(fz_pixmap **pixp, fz_irect r, int n)
r.y1 - r.y0, n);
}
-fz_error
+fz_error
fz_newpixmapcopy(fz_pixmap **pixp, fz_pixmap *old)
{
fz_error error;
diff --git a/fitzdraw/render.c b/fitzdraw/render.c
index 133c5ed0..48c5fd05 100644
--- a/fitzdraw/render.c
+++ b/fitzdraw/render.c
@@ -23,7 +23,7 @@
static fz_error rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm);
-fz_error
+fz_error
fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem)
{
fz_error error;
@@ -31,7 +31,7 @@ fz_newrenderer(fz_renderer **gcp, fz_colorspace *pcm, int maskonly, int gcmem)
gc = fz_malloc(sizeof(fz_renderer));
if (!gc)
- return fz_outofmem;
+ return fz_rethrow(-1, "out of memory");
gc->maskonly = maskonly;
gc->model = pcm;
@@ -91,7 +91,7 @@ fz_droprenderer(fz_renderer *gc)
* Transform
*/
-static fz_error
+static fz_error
rendertransform(fz_renderer *gc, fz_transformnode *transform, fz_matrix ctm)
{
fz_error error;
@@ -110,7 +110,7 @@ DEBUG("}\n");
* Color
*/
-static fz_error
+static fz_error
rendersolid(fz_renderer *gc, fz_solidnode *solid, fz_matrix ctm)
{
fz_error error;
@@ -184,7 +184,7 @@ DEBUG("solid %s [%d %d %d %d];\n", solid->cs->name, gc->argb[0], gc->argb[1], gc
* Path
*/
-static fz_error
+static fz_error
renderpath(fz_renderer *gc, fz_pathnode *path, fz_matrix ctm)
{
fz_error error;
@@ -307,7 +307,7 @@ static void drawglyph(fz_renderer *gc, fz_pixmap *dst, fz_glyph *src, int xorig,
}
}
-static fz_error
+static fz_error
rendertext(fz_renderer *gc, fz_textnode *text, fz_matrix ctm)
{
fz_error error;
@@ -385,7 +385,7 @@ calcimagescale(fz_matrix ctm, int w, int h, int *odx, int *ody)
*ody = dy;
}
-static fz_error
+static fz_error
renderimage(fz_renderer *gc, fz_imagenode *node, fz_matrix ctm)
{
fz_error error;
@@ -565,7 +565,7 @@ cleanup:
* Shade
*/
-static fz_error
+static fz_error
rendershade(fz_renderer *gc, fz_shadenode *node, fz_matrix ctm)
{
fz_error error;
@@ -682,7 +682,7 @@ blendmask(fz_renderer *gc, fz_pixmap *src, fz_pixmap *msk, fz_pixmap *dst, int o
}
}
-static fz_error
+static fz_error
renderover(fz_renderer *gc, fz_overnode *over, fz_matrix ctm)
{
fz_error error;
@@ -727,7 +727,7 @@ DEBUG("}\n");
return fz_okay;
}
-static fz_error
+static fz_error
rendermask(fz_renderer *gc, fz_masknode *mask, fz_matrix ctm)
{
fz_error error;
@@ -851,7 +851,7 @@ cleanup:
* Dispatch
*/
-static fz_error
+static fz_error
rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm)
{
if (!node)
@@ -888,7 +888,7 @@ rendernode(fz_renderer *gc, fz_node *node, fz_matrix ctm)
return fz_okay;
}
-fz_error
+fz_error
fz_rendertree(fz_pixmap **outp,
fz_renderer *gc, fz_tree *tree, fz_matrix ctm,
fz_irect bbox, int white)
@@ -933,7 +933,7 @@ DEBUG("}\n");
return fz_okay;
}
-fz_error
+fz_error
fz_rendertreeover(fz_renderer *gc, fz_pixmap *dest, fz_tree *tree, fz_matrix ctm)
{
fz_error error;