summaryrefslogtreecommitdiff
path: root/fitz/dev_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'fitz/dev_list.c')
-rw-r--r--fitz/dev_list.c488
1 files changed, 244 insertions, 244 deletions
diff --git a/fitz/dev_list.c b/fitz/dev_list.c
index 2bba6ed3..d9293dc4 100644
--- a/fitz/dev_list.c
+++ b/fitz/dev_list.c
@@ -3,24 +3,24 @@
#define ISOLATED 1
#define KNOCKOUT 2
-static fz_displaynode *
-fz_newdisplaynode(fz_displaycommand cmd, fz_matrix ctm,
+static fz_display_node *
+fz_new_display_node(fz_display_command cmd, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
+ fz_display_node *node;
int i;
- node = fz_malloc(sizeof(fz_displaynode));
+ node = fz_malloc(sizeof(fz_display_node));
node->cmd = cmd;
- node->next = nil;
- node->rect = fz_emptyrect;
- node->item.path = nil;
- node->stroke = nil;
+ node->next = NULL;
+ node->rect = fz_empty_rect;
+ node->item.path = NULL;
+ node->stroke = NULL;
node->flag = 0;
node->ctm = ctm;
if (colorspace)
{
- node->colorspace = fz_keepcolorspace(colorspace);
+ node->colorspace = fz_keep_colorspace(colorspace);
if (color)
{
for (i = 0; i < node->colorspace->n; i++)
@@ -29,23 +29,23 @@ fz_newdisplaynode(fz_displaycommand cmd, fz_matrix ctm,
}
else
{
- node->colorspace = nil;
+ node->colorspace = NULL;
}
node->alpha = alpha;
return node;
}
-static fz_strokestate *
-fz_clonestrokestate(fz_strokestate *stroke)
+static fz_stroke_state *
+fz_clone_stroke_state(fz_stroke_state *stroke)
{
- fz_strokestate *newstroke = fz_malloc(sizeof(fz_strokestate));
+ fz_stroke_state *newstroke = fz_malloc(sizeof(fz_stroke_state));
*newstroke = *stroke;
return newstroke;
}
static void
-fz_appenddisplaynode(fz_displaylist *list, fz_displaynode *node)
+fz_append_display_node(fz_display_list *list, fz_display_node *node)
{
if (!list->first)
{
@@ -60,244 +60,244 @@ fz_appenddisplaynode(fz_displaylist *list, fz_displaynode *node)
}
static void
-fz_freedisplaynode(fz_displaynode *node)
+fz_free_display_node(fz_display_node *node)
{
switch (node->cmd)
{
- case FZ_CMDFILLPATH:
- case FZ_CMDSTROKEPATH:
- case FZ_CMDCLIPPATH:
- case FZ_CMDCLIPSTROKEPATH:
- fz_freepath(node->item.path);
+ case FZ_CMD_FILL_PATH:
+ case FZ_CMD_STROKE_PATH:
+ case FZ_CMD_CLIP_PATH:
+ case FZ_CMD_CLIP_STROKE_PATH:
+ fz_free_path(node->item.path);
break;
- case FZ_CMDFILLTEXT:
- case FZ_CMDSTROKETEXT:
- case FZ_CMDCLIPTEXT:
- case FZ_CMDCLIPSTROKETEXT:
- case FZ_CMDIGNORETEXT:
- fz_freetext(node->item.text);
+ case FZ_CMD_FILL_TEXT:
+ case FZ_CMD_STROKE_TEXT:
+ case FZ_CMD_CLIP_TEXT:
+ case FZ_CMD_CLIP_STROKE_TEXT:
+ case FZ_CMD_IGNORE_TEXT:
+ fz_free_text(node->item.text);
break;
- case FZ_CMDFILLSHADE:
- fz_dropshade(node->item.shade);
+ case FZ_CMD_FILL_SHADE:
+ fz_drop_shade(node->item.shade);
break;
- case FZ_CMDFILLIMAGE:
- case FZ_CMDFILLIMAGEMASK:
- case FZ_CMDCLIPIMAGEMASK:
- fz_droppixmap(node->item.image);
+ case FZ_CMD_FILL_IMAGE:
+ case FZ_CMD_FILL_IMAGE_MASK:
+ case FZ_CMD_CLIP_IMAGE_MASK:
+ fz_drop_pixmap(node->item.image);
break;
- case FZ_CMDPOPCLIP:
- case FZ_CMDBEGINMASK:
- case FZ_CMDENDMASK:
- case FZ_CMDBEGINGROUP:
- case FZ_CMDENDGROUP:
- case FZ_CMDBEGINTILE:
- case FZ_CMDENDTILE:
+ case FZ_CMD_POP_CLIP:
+ case FZ_CMD_BEGIN_MASK:
+ case FZ_CMD_END_MASK:
+ case FZ_CMD_BEGIN_GROUP:
+ case FZ_CMD_END_GROUP:
+ case FZ_CMD_BEGIN_TILE:
+ case FZ_CMD_END_TILE:
break;
}
if (node->stroke)
fz_free(node->stroke);
if (node->colorspace)
- fz_dropcolorspace(node->colorspace);
+ fz_drop_colorspace(node->colorspace);
fz_free(node);
}
static void
-fz_listfillpath(void *user, fz_path *path, int evenodd, fz_matrix ctm,
+fz_list_fill_path(void *user, fz_path *path, int even_odd, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDFILLPATH, ctm, colorspace, color, alpha);
- node->rect = fz_boundpath(path, nil, ctm);
- node->item.path = fz_clonepath(path);
- node->flag = evenodd;
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_FILL_PATH, ctm, colorspace, color, alpha);
+ node->rect = fz_bound_path(path, NULL, ctm);
+ node->item.path = fz_clone_path(path);
+ node->flag = even_odd;
+ fz_append_display_node(user, node);
}
static void
-fz_liststrokepath(void *user, fz_path *path, fz_strokestate *stroke, fz_matrix ctm,
+fz_list_stroke_path(void *user, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDSTROKEPATH, ctm, colorspace, color, alpha);
- node->rect = fz_boundpath(path, stroke, ctm);
- node->item.path = fz_clonepath(path);
- node->stroke = fz_clonestrokestate(stroke);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_STROKE_PATH, ctm, colorspace, color, alpha);
+ node->rect = fz_bound_path(path, stroke, ctm);
+ node->item.path = fz_clone_path(path);
+ node->stroke = fz_clone_stroke_state(stroke);
+ fz_append_display_node(user, node);
}
static void
-fz_listclippath(void *user, fz_path *path, int evenodd, fz_matrix ctm)
+fz_list_clip_path(void *user, fz_path *path, int even_odd, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDCLIPPATH, ctm, nil, nil, 0);
- node->rect = fz_boundpath(path, nil, ctm);
- node->item.path = fz_clonepath(path);
- node->flag = evenodd;
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_CLIP_PATH, ctm, NULL, NULL, 0);
+ node->rect = fz_bound_path(path, NULL, ctm);
+ node->item.path = fz_clone_path(path);
+ node->flag = even_odd;
+ fz_append_display_node(user, node);
}
static void
-fz_listclipstrokepath(void *user, fz_path *path, fz_strokestate *stroke, fz_matrix ctm)
+fz_list_clip_stroke_path(void *user, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDCLIPSTROKEPATH, ctm, nil, nil, 0);
- node->rect = fz_boundpath(path, stroke, ctm);
- node->item.path = fz_clonepath(path);
- node->stroke = fz_clonestrokestate(stroke);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_CLIP_STROKE_PATH, ctm, NULL, NULL, 0);
+ node->rect = fz_bound_path(path, stroke, ctm);
+ node->item.path = fz_clone_path(path);
+ node->stroke = fz_clone_stroke_state(stroke);
+ fz_append_display_node(user, node);
}
static void
-fz_listfilltext(void *user, fz_text *text, fz_matrix ctm,
+fz_list_fill_text(void *user, fz_text *text, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDFILLTEXT, ctm, colorspace, color, alpha);
- node->rect = fz_boundtext(text, ctm);
- node->item.text = fz_clonetext(text);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_FILL_TEXT, ctm, colorspace, color, alpha);
+ node->rect = fz_bound_text(text, ctm);
+ node->item.text = fz_clone_text(text);
+ fz_append_display_node(user, node);
}
static void
-fz_liststroketext(void *user, fz_text *text, fz_strokestate *stroke, fz_matrix ctm,
+fz_list_stroke_text(void *user, fz_text *text, fz_stroke_state *stroke, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDSTROKETEXT, ctm, colorspace, color, alpha);
- node->rect = fz_boundtext(text, ctm);
- node->item.text = fz_clonetext(text);
- node->stroke = fz_clonestrokestate(stroke);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_STROKE_TEXT, ctm, colorspace, color, alpha);
+ node->rect = fz_bound_text(text, ctm);
+ node->item.text = fz_clone_text(text);
+ node->stroke = fz_clone_stroke_state(stroke);
+ fz_append_display_node(user, node);
}
static void
-fz_listcliptext(void *user, fz_text *text, fz_matrix ctm, int accumulate)
+fz_list_clip_text(void *user, fz_text *text, fz_matrix ctm, int accumulate)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDCLIPTEXT, ctm, nil, nil, 0);
- node->rect = fz_boundtext(text, ctm);
- node->item.text = fz_clonetext(text);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_CLIP_TEXT, ctm, NULL, NULL, 0);
+ node->rect = fz_bound_text(text, ctm);
+ node->item.text = fz_clone_text(text);
node->flag = accumulate;
/* when accumulating, be conservative about culling */
if (accumulate)
- node->rect = fz_infiniterect;
- fz_appenddisplaynode(user, node);
+ node->rect = fz_infinite_rect;
+ fz_append_display_node(user, node);
}
static void
-fz_listclipstroketext(void *user, fz_text *text, fz_strokestate *stroke, fz_matrix ctm)
+fz_list_clip_stroke_text(void *user, fz_text *text, fz_stroke_state *stroke, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDCLIPSTROKETEXT, ctm, nil, nil, 0);
- node->rect = fz_boundtext(text, ctm);
- node->item.text = fz_clonetext(text);
- node->stroke = fz_clonestrokestate(stroke);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_CLIP_STROKE_TEXT, ctm, NULL, NULL, 0);
+ node->rect = fz_bound_text(text, ctm);
+ node->item.text = fz_clone_text(text);
+ node->stroke = fz_clone_stroke_state(stroke);
+ fz_append_display_node(user, node);
}
static void
-fz_listignoretext(void *user, fz_text *text, fz_matrix ctm)
+fz_list_ignore_text(void *user, fz_text *text, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDIGNORETEXT, ctm, nil, nil, 0);
- node->rect = fz_boundtext(text, ctm);
- node->item.text = fz_clonetext(text);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_IGNORE_TEXT, ctm, NULL, NULL, 0);
+ node->rect = fz_bound_text(text, ctm);
+ node->item.text = fz_clone_text(text);
+ fz_append_display_node(user, node);
}
static void
-fz_listpopclip(void *user)
+fz_list_pop_clip(void *user)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDPOPCLIP, fz_identity, nil, nil, 0);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_POP_CLIP, fz_identity, NULL, NULL, 0);
/* TODO: scan back for matching pushclip and calculate bbox of contents */
- fz_appenddisplaynode(user, node);
+ fz_append_display_node(user, node);
}
static void
-fz_listfillshade(void *user, fz_shade *shade, fz_matrix ctm, float alpha)
+fz_list_fill_shade(void *user, fz_shade *shade, fz_matrix ctm, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDFILLSHADE, ctm, nil, nil, alpha);
- node->rect = fz_boundshade(shade, ctm);
- node->item.shade = fz_keepshade(shade);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_FILL_SHADE, ctm, NULL, NULL, alpha);
+ node->rect = fz_bound_shade(shade, ctm);
+ node->item.shade = fz_keep_shade(shade);
+ fz_append_display_node(user, node);
}
static void
-fz_listfillimage(void *user, fz_pixmap *image, fz_matrix ctm, float alpha)
+fz_list_fill_image(void *user, fz_pixmap *image, fz_matrix ctm, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDFILLIMAGE, ctm, nil, nil, alpha);
- node->rect = fz_transformrect(ctm, fz_unitrect);
- node->item.image = fz_keeppixmap(image);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_FILL_IMAGE, ctm, NULL, NULL, alpha);
+ node->rect = fz_transform_rect(ctm, fz_unit_rect);
+ node->item.image = fz_keep_pixmap(image);
+ fz_append_display_node(user, node);
}
static void
-fz_listfillimagemask(void *user, fz_pixmap *image, fz_matrix ctm,
+fz_list_fill_image_mask(void *user, fz_pixmap *image, fz_matrix ctm,
fz_colorspace *colorspace, float *color, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDFILLIMAGEMASK, ctm, colorspace, color, alpha);
- node->rect = fz_transformrect(ctm, fz_unitrect);
- node->item.image = fz_keeppixmap(image);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_FILL_IMAGE_MASK, ctm, colorspace, color, alpha);
+ node->rect = fz_transform_rect(ctm, fz_unit_rect);
+ node->item.image = fz_keep_pixmap(image);
+ fz_append_display_node(user, node);
}
static void
-fz_listclipimagemask(void *user, fz_pixmap *image, fz_matrix ctm)
+fz_list_clip_image_mask(void *user, fz_pixmap *image, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDCLIPIMAGEMASK, ctm, nil, nil, 0);
- node->rect = fz_transformrect(ctm, fz_unitrect);
- node->item.image = fz_keeppixmap(image);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_CLIP_IMAGE_MASK, ctm, NULL, NULL, 0);
+ node->rect = fz_transform_rect(ctm, fz_unit_rect);
+ node->item.image = fz_keep_pixmap(image);
+ fz_append_display_node(user, node);
}
static void
-fz_listbeginmask(void *user, fz_rect rect, int luminosity, fz_colorspace *colorspace, float *color)
+fz_list_begin_mask(void *user, fz_rect rect, int luminosity, fz_colorspace *colorspace, float *color)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDBEGINMASK, fz_identity, colorspace, color, 0);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_BEGIN_MASK, fz_identity, colorspace, color, 0);
node->rect = rect;
node->flag = luminosity;
- fz_appenddisplaynode(user, node);
+ fz_append_display_node(user, node);
}
static void
-fz_listendmask(void *user)
+fz_list_end_mask(void *user)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDENDMASK, fz_identity, nil, nil, 0);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_END_MASK, fz_identity, NULL, NULL, 0);
+ fz_append_display_node(user, node);
}
static void
-fz_listbegingroup(void *user, fz_rect rect, int isolated, int knockout, fz_blendmode blendmode, float alpha)
+fz_list_begin_group(void *user, fz_rect rect, int isolated, int knockout, fz_blendmode blendmode, float alpha)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDBEGINGROUP, fz_identity, nil, nil, alpha);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_BEGIN_GROUP, fz_identity, NULL, NULL, alpha);
node->rect = rect;
node->item.blendmode = blendmode;
node->flag |= isolated ? ISOLATED : 0;
node->flag |= knockout ? KNOCKOUT : 0;
- fz_appenddisplaynode(user, node);
+ fz_append_display_node(user, node);
}
static void
-fz_listendgroup(void *user)
+fz_list_end_group(void *user)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDENDGROUP, fz_identity, nil, nil, 0);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_END_GROUP, fz_identity, NULL, NULL, 0);
+ fz_append_display_node(user, node);
}
static void
-fz_listbegintile(void *user, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm)
+fz_list_begin_tile(void *user, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDBEGINTILE, ctm, nil, nil, 0);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_BEGIN_TILE, ctm, NULL, NULL, 0);
node->rect = area;
node->color[0] = xstep;
node->color[1] = ystep;
@@ -305,82 +305,82 @@ fz_listbegintile(void *user, fz_rect area, fz_rect view, float xstep, float yste
node->color[3] = view.y0;
node->color[4] = view.x1;
node->color[5] = view.y1;
- fz_appenddisplaynode(user, node);
+ fz_append_display_node(user, node);
}
static void
-fz_listendtile(void *user)
+fz_list_end_tile(void *user)
{
- fz_displaynode *node;
- node = fz_newdisplaynode(FZ_CMDENDTILE, fz_identity, nil, nil, 0);
- fz_appenddisplaynode(user, node);
+ fz_display_node *node;
+ node = fz_new_display_node(FZ_CMD_END_TILE, fz_identity, NULL, NULL, 0);
+ fz_append_display_node(user, node);
}
fz_device *
-fz_newlistdevice(fz_displaylist *list)
+fz_new_list_device(fz_display_list *list)
{
- fz_device *dev = fz_newdevice(list);
+ fz_device *dev = fz_new_device(list);
- dev->fillpath = fz_listfillpath;
- dev->strokepath = fz_liststrokepath;
- dev->clippath = fz_listclippath;
- dev->clipstrokepath = fz_listclipstrokepath;
+ dev->fill_path = fz_list_fill_path;
+ dev->stroke_path = fz_list_stroke_path;
+ dev->clip_path = fz_list_clip_path;
+ dev->clip_stroke_path = fz_list_clip_stroke_path;
- dev->filltext = fz_listfilltext;
- dev->stroketext = fz_liststroketext;
- dev->cliptext = fz_listcliptext;
- dev->clipstroketext = fz_listclipstroketext;
- dev->ignoretext = fz_listignoretext;
+ dev->fill_text = fz_list_fill_text;
+ dev->stroke_text = fz_list_stroke_text;
+ dev->clip_text = fz_list_clip_text;
+ dev->clip_stroke_text = fz_list_clip_stroke_text;
+ dev->ignore_text = fz_list_ignore_text;
- dev->fillshade = fz_listfillshade;
- dev->fillimage = fz_listfillimage;
- dev->fillimagemask = fz_listfillimagemask;
- dev->clipimagemask = fz_listclipimagemask;
+ dev->fill_shade = fz_list_fill_shade;
+ dev->fill_image = fz_list_fill_image;
+ dev->fill_image_mask = fz_list_fill_image_mask;
+ dev->clip_image_mask = fz_list_clip_image_mask;
- dev->popclip = fz_listpopclip;
+ dev->pop_clip = fz_list_pop_clip;
- dev->beginmask = fz_listbeginmask;
- dev->endmask = fz_listendmask;
- dev->begingroup = fz_listbegingroup;
- dev->endgroup = fz_listendgroup;
+ dev->begin_mask = fz_list_begin_mask;
+ dev->end_mask = fz_list_end_mask;
+ dev->begin_group = fz_list_begin_group;
+ dev->end_group = fz_list_end_group;
- dev->begintile = fz_listbegintile;
- dev->endtile = fz_listendtile;
+ dev->begin_tile = fz_list_begin_tile;
+ dev->end_tile = fz_list_end_tile;
return dev;
}
-fz_displaylist *
-fz_newdisplaylist(void)
+fz_display_list *
+fz_new_display_list(void)
{
- fz_displaylist *list = fz_malloc(sizeof(fz_displaylist));
- list->first = nil;
- list->last = nil;
+ fz_display_list *list = fz_malloc(sizeof(fz_display_list));
+ list->first = NULL;
+ list->last = NULL;
return list;
}
void
-fz_freedisplaylist(fz_displaylist *list)
+fz_free_display_list(fz_display_list *list)
{
- fz_displaynode *node = list->first;
+ fz_display_node *node = list->first;
while (node)
{
- fz_displaynode *next = node->next;
- fz_freedisplaynode(node);
+ fz_display_node *next = node->next;
+ fz_free_display_node(node);
node = next;
}
fz_free(list);
}
void
-fz_executedisplaylist(fz_displaylist *list, fz_device *dev, fz_matrix topctm, fz_bbox bounds)
+fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm, fz_bbox bounds)
{
- fz_displaynode *node;
+ fz_display_node *node;
fz_rect bbox;
int clipped = 0;
int tiled = 0;
- if (!fz_isinfinitebbox(bounds))
+ if (!fz_is_infinite_bbox(bounds))
{
/* add some fuzz at the edges, as especially glyph rects
* are sometimes not actually completely bounding the glyph */
@@ -390,40 +390,40 @@ fz_executedisplaylist(fz_displaylist *list, fz_device *dev, fz_matrix topctm, fz
for (node = list->first; node; node = node->next)
{
- fz_matrix ctm = fz_concat(node->ctm, topctm);
- fz_rect rect = fz_transformrect(topctm, node->rect);
+ fz_matrix ctm = fz_concat(node->ctm, top_ctm);
+ fz_rect rect = fz_transform_rect(top_ctm, node->rect);
/* never skip tiles */
if (tiled)
goto visible;
/* cull objects to draw using a quick visibility test */
- if (clipped || fz_isemptybbox(fz_intersectbbox(fz_roundrect(rect), bounds)))
+ if (clipped || fz_is_empty_bbox(fz_intersect_bbox(fz_round_rect(rect), bounds)))
{
switch (node->cmd)
{
- case FZ_CMDBEGINTILE:
+ case FZ_CMD_BEGIN_TILE:
tiled++;
goto visible;
- case FZ_CMDENDTILE:
+ case FZ_CMD_END_TILE:
tiled--;
goto visible;
- case FZ_CMDCLIPPATH:
- case FZ_CMDCLIPSTROKEPATH:
- case FZ_CMDCLIPTEXT:
- case FZ_CMDCLIPSTROKETEXT:
- case FZ_CMDCLIPIMAGEMASK:
- case FZ_CMDBEGINMASK:
- case FZ_CMDBEGINGROUP:
+ case FZ_CMD_CLIP_PATH:
+ case FZ_CMD_CLIP_STROKE_PATH:
+ case FZ_CMD_CLIP_TEXT:
+ case FZ_CMD_CLIP_STROKE_TEXT:
+ case FZ_CMD_CLIP_IMAGE_MASK:
+ case FZ_CMD_BEGIN_MASK:
+ case FZ_CMD_BEGIN_GROUP:
clipped++;
continue;
- case FZ_CMDPOPCLIP:
- case FZ_CMDENDGROUP:
+ case FZ_CMD_POP_CLIP:
+ case FZ_CMD_END_GROUP:
if (!clipped)
goto visible;
clipped--;
continue;
- case FZ_CMDENDMASK:
+ case FZ_CMD_END_MASK:
if (!clipped)
goto visible;
continue;
@@ -435,79 +435,79 @@ fz_executedisplaylist(fz_displaylist *list, fz_device *dev, fz_matrix topctm, fz
visible:
switch (node->cmd)
{
- case FZ_CMDFILLPATH:
- dev->fillpath(dev->user, node->item.path, node->flag, ctm,
+ case FZ_CMD_FILL_PATH:
+ dev->fill_path(dev->user, node->item.path, node->flag, ctm,
node->colorspace, node->color, node->alpha);
break;
- case FZ_CMDSTROKEPATH:
- dev->strokepath(dev->user, node->item.path, node->stroke, ctm,
+ case FZ_CMD_STROKE_PATH:
+ dev->stroke_path(dev->user, node->item.path, node->stroke, ctm,
node->colorspace, node->color, node->alpha);
break;
- case FZ_CMDCLIPPATH:
- dev->clippath(dev->user, node->item.path, node->flag, ctm);
+ case FZ_CMD_CLIP_PATH:
+ dev->clip_path(dev->user, node->item.path, node->flag, ctm);
break;
- case FZ_CMDCLIPSTROKEPATH:
- dev->clipstrokepath(dev->user, node->item.path, node->stroke, ctm);
+ case FZ_CMD_CLIP_STROKE_PATH:
+ dev->clip_stroke_path(dev->user, node->item.path, node->stroke, ctm);
break;
- case FZ_CMDFILLTEXT:
- dev->filltext(dev->user, node->item.text, ctm,
+ case FZ_CMD_FILL_TEXT:
+ dev->fill_text(dev->user, node->item.text, ctm,
node->colorspace, node->color, node->alpha);
break;
- case FZ_CMDSTROKETEXT:
- dev->stroketext(dev->user, node->item.text, node->stroke, ctm,
+ case FZ_CMD_STROKE_TEXT:
+ dev->stroke_text(dev->user, node->item.text, node->stroke, ctm,
node->colorspace, node->color, node->alpha);
break;
- case FZ_CMDCLIPTEXT:
- dev->cliptext(dev->user, node->item.text, ctm, node->flag);
+ case FZ_CMD_CLIP_TEXT:
+ dev->clip_text(dev->user, node->item.text, ctm, node->flag);
break;
- case FZ_CMDCLIPSTROKETEXT:
- dev->clipstroketext(dev->user, node->item.text, node->stroke, ctm);
+ case FZ_CMD_CLIP_STROKE_TEXT:
+ dev->clip_stroke_text(dev->user, node->item.text, node->stroke, ctm);
break;
- case FZ_CMDIGNORETEXT:
- dev->ignoretext(dev->user, node->item.text, ctm);
+ case FZ_CMD_IGNORE_TEXT:
+ dev->ignore_text(dev->user, node->item.text, ctm);
break;
- case FZ_CMDFILLSHADE:
- dev->fillshade(dev->user, node->item.shade, ctm, node->alpha);
+ case FZ_CMD_FILL_SHADE:
+ dev->fill_shade(dev->user, node->item.shade, ctm, node->alpha);
break;
- case FZ_CMDFILLIMAGE:
- dev->fillimage(dev->user, node->item.image, ctm, node->alpha);
+ case FZ_CMD_FILL_IMAGE:
+ dev->fill_image(dev->user, node->item.image, ctm, node->alpha);
break;
- case FZ_CMDFILLIMAGEMASK:
- dev->fillimagemask(dev->user, node->item.image, ctm,
+ case FZ_CMD_FILL_IMAGE_MASK:
+ dev->fill_image_mask(dev->user, node->item.image, ctm,
node->colorspace, node->color, node->alpha);
break;
- case FZ_CMDCLIPIMAGEMASK:
- dev->clipimagemask(dev->user, node->item.image, ctm);
+ case FZ_CMD_CLIP_IMAGE_MASK:
+ dev->clip_image_mask(dev->user, node->item.image, ctm);
break;
- case FZ_CMDPOPCLIP:
- dev->popclip(dev->user);
+ case FZ_CMD_POP_CLIP:
+ dev->pop_clip(dev->user);
break;
- case FZ_CMDBEGINMASK:
- bbox = fz_transformrect(topctm, node->rect);
- dev->beginmask(dev->user, bbox, node->flag, node->colorspace, node->color);
+ case FZ_CMD_BEGIN_MASK:
+ bbox = fz_transform_rect(top_ctm, node->rect);
+ dev->begin_mask(dev->user, bbox, node->flag, node->colorspace, node->color);
break;
- case FZ_CMDENDMASK:
- dev->endmask(dev->user);
+ case FZ_CMD_END_MASK:
+ dev->end_mask(dev->user);
break;
- case FZ_CMDBEGINGROUP:
- bbox = fz_transformrect(topctm, node->rect);
- dev->begingroup(dev->user, bbox,
+ case FZ_CMD_BEGIN_GROUP:
+ bbox = fz_transform_rect(top_ctm, node->rect);
+ dev->begin_group(dev->user, bbox,
node->flag & ISOLATED, node->flag & KNOCKOUT,
node->item.blendmode, node->alpha);
break;
- case FZ_CMDENDGROUP:
- dev->endgroup(dev->user);
+ case FZ_CMD_END_GROUP:
+ dev->end_group(dev->user);
break;
- case FZ_CMDBEGINTILE:
+ case FZ_CMD_BEGIN_TILE:
bbox.x0 = node->color[2];
bbox.y0 = node->color[3];
bbox.x1 = node->color[4];
bbox.y1 = node->color[5];
- dev->begintile(dev->user, node->rect, bbox,
+ dev->begin_tile(dev->user, node->rect, bbox,
node->color[0], node->color[1], ctm);
break;
- case FZ_CMDENDTILE:
- dev->endtile(dev->user);
+ case FZ_CMD_END_TILE:
+ dev->end_tile(dev->user);
break;
}
}