summaryrefslogtreecommitdiff
path: root/pxl
diff options
context:
space:
mode:
authorHenry Stiles <henry.stiles@artifex.com>2011-01-14 21:54:23 +0000
committerHenry Stiles <henry.stiles@artifex.com>2011-01-14 21:54:23 +0000
commitdcde71a463f92b75284dbb98a2bbe32936f9ae27 (patch)
treea5a511afde1a7fddab9ec25f0c5299afbb2686a2 /pxl
parente5bd8f74d73b1a3de359a6540ce471902cd93514 (diff)
Disable software clipping to emulate the HP 1/6" inch hardware margin.
The margin should be set in the device and more recent HP devices allow the margin to be configurable and even 0 for full bleed. A similar change for PCL will follow. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@12027 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'pxl')
-rw-r--r--pxl/pxgstate.c2
-rw-r--r--pxl/pxgstate.h3
-rw-r--r--pxl/pxsessio.c55
3 files changed, 1 insertions, 59 deletions
diff --git a/pxl/pxgstate.c b/pxl/pxgstate.c
index d3c465579..5ed96d446 100644
--- a/pxl/pxgstate.c
+++ b/pxl/pxgstate.c
@@ -307,7 +307,7 @@ px_gstate_reset(px_gstate_t *pxgs)
int
px_initclip(px_state_t *pxs)
{
- return gx_clip_to_rectangle(pxs->pgs, &pxs->pxgs->initial_clip_rect);
+ return gs_initclip(pxs->pgs);
}
static bool
diff --git a/pxl/pxgstate.h b/pxl/pxgstate.h
index 197798f69..4ef8f4a7d 100644
--- a/pxl/pxgstate.h
+++ b/pxl/pxgstate.h
@@ -158,9 +158,6 @@ typedef struct px_gstate_s {
bool char_matrix_set;
int stack_depth; /* # of unmatched PushGS */
const pl_symbol_map_t *symbol_map; /* symbol mapping */
- gs_fixed_rect initial_clip_rect; /* the intersection of hardware
- margins and the infamous PCL 1/6"
- border */
} px_gstate_t;
#define private_st_px_gstate() /* in pxgstate.c */\
gs_private_st_composite(st_px_gstate, px_gstate_t, "px_gstate_t",\
diff --git a/pxl/pxsessio.c b/pxl/pxsessio.c
index 61769e9b1..0ee0d6529 100644
--- a/pxl/pxsessio.c
+++ b/pxl/pxsessio.c
@@ -560,33 +560,6 @@ setd: { gs_memory_t *mem = pxs->memory;
gs_setmatrix(pgs, &mat);
pxs->initial_matrix = mat;
}
- {
- /* note we don't expect errors here since the
- coordinates are functions of media sizes known at
- compile time */
- gs_rect page_bbox, device_page_bbox;
- gs_fixed_rect fixed_bbox;
- /* XL requires a 1/6" border to print correctly, this
- will set up the border as long as we do not exceed
- the boundary of the hardware margins. If the
- engine's border is larger than 1/6" the XL output
- will be clipped by the engine and will not behave as
- expected */
- page_bbox.p.x = max(dev->HWMargins[0], pxs->pm->m_left * media_size_scale);
- page_bbox.p.y = max(dev->HWMargins[1], pxs->pm->m_top * media_size_scale);
- page_bbox.q.x = (pxs->media_width * media_size_scale) -
- max(dev->HWMargins[2], pxs->pm->m_bottom * media_size_scale);
- page_bbox.q.y = (pxs->media_height * media_size_scale) -
- max(dev->HWMargins[3], pxs->pm->m_right * media_size_scale);
- gs_bbox_transform(&page_bbox, &points2device, &device_page_bbox);
- /* clip to rectangle takes fixed coordinates */
- fixed_bbox.p.x = float2fixed(device_page_bbox.p.x);
- fixed_bbox.p.y = float2fixed(device_page_bbox.p.y);
- fixed_bbox.q.x = float2fixed(device_page_bbox.q.x);
- fixed_bbox.q.y = float2fixed(device_page_bbox.q.y);
- gx_clip_to_rectangle(pgs, &fixed_bbox);
- pxs->pxgs->initial_clip_rect = fixed_bbox;
- }
}
{ /*
* Set the default halftone method. We have to do this here,
@@ -688,34 +661,6 @@ pxBeginPageFromPassthrough(px_state_t *pxs)
gs_setmatrix(pgs, &mat);
pxs->initial_matrix = mat;
}
- {
- /* note we don't expect errors here since the
- coordinates are functions of media sizes known at
- compile time */
- gs_rect page_bbox, device_page_bbox;
- gs_fixed_rect fixed_bbox;
- /* XL requires a 1/6" border to print correctly, this
- will set up the border as long as we do not exceed
- the boundary of the hardware margins. If the
- engine's border is larger than 1/6" the XL output
- will be clipped by the engine and will not behave as
- expected */
- page_bbox.p.x = max(dev->HWMargins[0], pxs->pm->m_left * media_size_scale);
- page_bbox.p.y = max(dev->HWMargins[1], pxs->pm->m_top * media_size_scale);
- page_bbox.q.x = (pxs->media_width * media_size_scale) -
- max(dev->HWMargins[2], pxs->pm->m_bottom * media_size_scale);
- page_bbox.q.y = (pxs->media_height * media_size_scale) -
- max(dev->HWMargins[3], pxs->pm->m_right * media_size_scale);
- gs_bbox_transform(&page_bbox, &points2device, &device_page_bbox);
- /* clip to rectangle takes fixed coordinates */
- fixed_bbox.p.x = float2fixed(device_page_bbox.p.x);
- fixed_bbox.p.y = float2fixed(device_page_bbox.p.y);
- fixed_bbox.q.x = float2fixed(device_page_bbox.q.x);
- fixed_bbox.q.y = float2fixed(device_page_bbox.q.y);
- gx_clip_to_rectangle(pgs, &fixed_bbox);
- pxs->pxgs->initial_clip_rect = fixed_bbox;
- }
-
pxs->have_page = true;
return 0;
}