summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gs/base/gdevbbox.c4
-rw-r--r--gs/base/gdevpdfd.c1
-rw-r--r--gs/base/gdevtrac.c5
-rw-r--r--gs/base/gxacpath.c1
-rw-r--r--gs/base/gxclrast.c4
-rw-r--r--gs/base/gxcpath.c2
-rw-r--r--gs/base/gxfill.c32
-rw-r--r--gs/base/gxpaint.c1
-rw-r--r--gs/base/gxpaint.h2
-rw-r--r--gs/base/gxshade.c1
-rw-r--r--gs/base/gxstroke.c6
-rw-r--r--gs/base/gxttfb.c1
12 files changed, 2 insertions, 58 deletions
diff --git a/gs/base/gdevbbox.c b/gs/base/gdevbbox.c
index c8523e719..6caeefa6e 100644
--- a/gs/base/gdevbbox.c
+++ b/gs/base/gdevbbox.c
@@ -760,8 +760,6 @@ bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
return 0;
gx_cpath_inner_box(pcpath, &ibox);
adjust = params->adjust;
- if (params->fill_zero_width)
- gx_adjust_if_empty(&ibox, &adjust);
adjust_box(&ibox, adjust);
BBOX_ADD_RECT(bdev, ibox.p.x, ibox.p.y, ibox.q.x, ibox.q.y);
return 0;
@@ -772,8 +770,6 @@ bbox_fill_path(gx_device * dev, const gs_imager_state * pis, gx_path * ppath,
if (gx_path_bbox(ppath, &ibox) < 0)
return 0;
adjust = params->adjust;
- if (params->fill_zero_width)
- gx_adjust_if_empty(&ibox, &adjust);
adjust_box(&ibox, adjust);
/*
* If the path lies within the already accumulated box, just draw
diff --git a/gs/base/gdevpdfd.c b/gs/base/gdevpdfd.c
index 6f19288a5..9e605c4e3 100644
--- a/gs/base/gdevpdfd.c
+++ b/gs/base/gdevpdfd.c
@@ -1405,7 +1405,6 @@ gdev_pdf_fill_rectangle_hl_color(gx_device *dev, const gs_fixed_rect *rect,
params.rule = 1; /* Not important because the path is a rectange. */
params.adjust.x = params.adjust.y = 0;
params.flatness = pis->flatness;
- params.fill_zero_width = false;
gx_path_init_local(&path, pis->memory);
code = gx_path_add_rectangle(&path, rect->p.x, rect->p.y, rect->q.x, rect->q.y);
if (code < 0)
diff --git a/gs/base/gdevtrac.c b/gs/base/gdevtrac.c
index 546b96c55..0d136792b 100644
--- a/gs/base/gdevtrac.c
+++ b/gs/base/gdevtrac.c
@@ -290,10 +290,9 @@ trace_fill_path(gx_device * dev, const gs_imager_state * pis,
dputs("fill_path({\n");
trace_path(ppath);
trace_drawing_color("}, ", pdcolor);
- dprintf5(", rule=%d, adjust=(%g,%g), flatness=%g, fill_zero_width=%s",
+ dprintf4(", rule=%d, adjust=(%g,%g), flatness=%g",
params->rule, fixed2float(params->adjust.x),
- fixed2float(params->adjust.y), params->flatness,
- (params->fill_zero_width ? "true" : "false"));
+ fixed2float(params->adjust.y), params->flatness);
trace_clip(dev, pcpath);
/****** pis ******/
dputs(")\n");
diff --git a/gs/base/gxacpath.c b/gs/base/gxacpath.c
index ec85c333b..ff894fc7f 100644
--- a/gs/base/gxacpath.c
+++ b/gs/base/gxacpath.c
@@ -207,7 +207,6 @@ gx_cpath_intersect_path_slow(gx_clip_path * pcpath, gx_path * ppath,
params.adjust.x = float2fixed(fadjust.x);
params.adjust.y = float2fixed(fadjust.y);
params.flatness = gs_currentflat_inline(pis);
- params.fill_zero_width = true;
}
code = gx_fill_path_only(ppath, (gx_device *)&adev, pis,
&params, &devc, pcpath);
diff --git a/gs/base/gxclrast.c b/gs/base/gxclrast.c
index e98f24a43..93d45034f 100644
--- a/gs/base/gxclrast.c
+++ b/gs/base/gxclrast.c
@@ -598,7 +598,6 @@ in: /* Initialize for a new page. */
gx_set_cmap_procs(&imager_state, tdev);
gx_imager_setscreenphase(&imager_state, -x0, -y0, gs_color_select_all);
halftone_type = ht_type_none;
- fill_params.fill_zero_width = false;
pcs = gs_cspace_new_DeviceGray(mem);
if (pcs == NULL) {
code = gs_note_error(gs_error_VMerror);
@@ -1777,9 +1776,6 @@ idata: data_size = 0;
fill:
fill_params.adjust = imager_state.fill_adjust;
fill_params.flatness = imager_state.flatness;
- fill_params.fill_zero_width =
- fill_params.adjust.x != 0 ||
- fill_params.adjust.y != 0;
code = gx_fill_path_only(ppath, tdev,
&imager_state,
&fill_params,
diff --git a/gs/base/gxcpath.c b/gs/base/gxcpath.c
index 690067641..211bc5630 100644
--- a/gs/base/gxcpath.c
+++ b/gs/base/gxcpath.c
@@ -602,8 +602,6 @@ gx_cpath_intersect_with_params(gx_clip_path *pcpath, /*const*/ gx_path *ppath_or
if (adjust.x == -1)
adjust_xl = adjust_xu = adjust_yl = adjust_yu = 0;
else {
- if (params->fill_zero_width)
- gx_adjust_if_empty(&new_box, &adjust);
adjust_xl = (adjust.x == fixed_half ? fixed_half - fixed_epsilon : adjust.x);
adjust_yl = (adjust.y == fixed_half ? fixed_half - fixed_epsilon : adjust.y);
adjust_xu = adjust.x;
diff --git a/gs/base/gxfill.c b/gs/base/gxfill.c
index 33bb88baf..794b2dfc0 100644
--- a/gs/base/gxfill.c
+++ b/gs/base/gxfill.c
@@ -255,36 +255,6 @@ unclose_path(gx_path * ppath, int count)
}
/*
- * Tweak the fill adjustment if necessary so that (nearly) empty
- * rectangles are guaranteed to produce some output. This is a hack
- * to work around a bug in the Microsoft Windows PostScript driver,
- * which draws thin lines by filling zero-width rectangles, and in
- * some other drivers that try to fill epsilon-width rectangles.
- */
-void
-gx_adjust_if_empty(const gs_fixed_rect * pbox, gs_fixed_point * adjust)
-{
- /*
- * For extremely large coordinates, the obvious subtractions could
- * overflow. We can work around this easily by noting that since
- * we know q.{x,y} >= p.{x,y}, the subtraction overflows iff the
- * result is negative.
- */
- const fixed
- dx = pbox->q.x - pbox->p.x, dy = pbox->q.y - pbox->p.y;
-
- if (dx < fixed_half && dx > 0 && (dy >= int2fixed(2) || dy < 0)) {
- adjust->x = arith_rshift_1(fixed_1 + fixed_epsilon - dx);
- if_debug1('f', "[f]thin adjust_x=%g\n",
- fixed2float(adjust->x));
- } else if (dy < fixed_half && dy > 0 && (dx >= int2fixed(2) || dx < 0)) {
- adjust->y = arith_rshift_1(fixed_1 + fixed_epsilon - dy);
- if_debug1('f', "[f]thin adjust_y=%g\n",
- fixed2float(adjust->y));
- }
-}
-
-/*
* The general fill path algorithm.
*/
static int
@@ -330,8 +300,6 @@ gx_general_fill_path(gx_device * pdev, const gs_imager_state * pis,
adjust.x = adjust.y = 0;
else
adjust = params->adjust;
- if (params->fill_zero_width && !pseudo_rasterization)
- gx_adjust_if_empty(&ibox, &adjust);
lst.contour_count = 0;
lst.windings = NULL;
lst.bbox_left = fixed2int(ibox.p.x - adjust.x - fixed_epsilon);
diff --git a/gs/base/gxpaint.c b/gs/base/gxpaint.c
index 50860bd28..4cad30622 100644
--- a/gs/base/gxpaint.c
+++ b/gs/base/gxpaint.c
@@ -45,7 +45,6 @@ gx_fill_path(gx_path * ppath, gx_device_color * pdevc, gs_state * pgs,
params.adjust.x = adjust_x;
params.adjust.y = adjust_y;
params.flatness = (caching_an_outline_font(pgs) ? 0.0 : pgs->flatness);
- params.fill_zero_width = (adjust_x | adjust_y) != 0;
return (*dev_proc(dev, fill_path))
(dev, (const gs_imager_state *)pgs, ppath, &params, pdevc, pcpath);
}
diff --git a/gs/base/gxpaint.h b/gs/base/gxpaint.h
index c8c792668..97fa7e9e0 100644
--- a/gs/base/gxpaint.h
+++ b/gs/base/gxpaint.h
@@ -95,8 +95,6 @@ struct gx_fill_params_s {
int rule; /* -1 = winding #, 1 = even/odd */
gs_fixed_point adjust;
float flatness;
- bool fill_zero_width; /* if true, make zero-width/height */
- /* rectangles one pixel wide/high */
};
#define gx_fill_path_only(ppath, dev, pis, params, pdevc, pcpath)\
diff --git a/gs/base/gxshade.c b/gs/base/gxshade.c
index 032bb0eb6..b22f45e84 100644
--- a/gs/base/gxshade.c
+++ b/gs/base/gxshade.c
@@ -380,7 +380,6 @@ shade_fill_path(const shading_fill_state_t * pfs, gx_path * ppath,
params.rule = -1; /* irrelevant */
params.adjust = *fill_adjust;
params.flatness = 0; /* irrelevant */
- params.fill_zero_width = false;
return (*dev_proc(pfs->dev, fill_path)) (pfs->dev, pfs->pis, ppath,
&params, pdevc, NULL);
}
diff --git a/gs/base/gxstroke.c b/gs/base/gxstroke.c
index 8a1f67dab..2c50319c3 100644
--- a/gs/base/gxstroke.c
+++ b/gs/base/gxstroke.c
@@ -457,12 +457,6 @@ gx_stroke_path_only_aux(gx_path * ppath, gx_path * to_path, gx_device * pdev,
}
fill_params.rule = gx_rule_winding_number;
fill_params.flatness = pis->flatness;
-#ifdef USE_FILL_ADJUSTMENT
- fill_params.fill_zero_width =
- (pis->fill_adjust.x | pis->fill_adjust.y) != 0;
-#else
- fill_params.fill_zero_width = false;
-#endif
if (line_width < 0)
line_width = -line_width;
line_width_and_scale = line_width * (double)int2fixed(1);
diff --git a/gs/base/gxttfb.c b/gs/base/gxttfb.c
index ad20bd057..d45ff54a2 100644
--- a/gs/base/gxttfb.c
+++ b/gs/base/gxttfb.c
@@ -689,7 +689,6 @@ static int grid_fit(gx_device_spot_analyzer *padev, gx_path *path,
params.rule = gx_rule_winding_number;
params.adjust.x = params.adjust.y = 0;
params.flatness = fixed2float(max(bbox.q.x - bbox.p.x, bbox.q.y - bbox.p.y)) / 100.0;
- params.fill_zero_width = false;
for (h.transpose = 0; h.transpose < 2; h.transpose++) {
h.midx = (padev->xmin + padev->xmax) / 2;