summaryrefslogtreecommitdiff
path: root/xps
diff options
context:
space:
mode:
Diffstat (limited to 'xps')
-rw-r--r--xps/muxps.h10
-rw-r--r--xps/xpscolor.c18
-rw-r--r--xps/xpsopacity.c20
-rw-r--r--xps/xpszip.c5
4 files changed, 8 insertions, 45 deletions
diff --git a/xps/muxps.h b/xps/muxps.h
index 1b137a59..8150996f 100644
--- a/xps/muxps.h
+++ b/xps/muxps.h
@@ -250,16 +250,6 @@ struct xps_context_s
xps_hash_table *font_table;
xps_hash_table *colorspace_table;
- /* Global toggle for transparency */
- int use_transparency;
-
- /* Hack to workaround ghostscript's lack of understanding
- * the pdf 1.4 specification of Alpha only transparency groups.
- * We have to force all colors to be grayscale whenever we are computing
- * opacity masks.
- */
- int opacity_only;
-
/* The fill_rule is set by path parsing.
* It is used by clip/fill functions.
* 1=nonzero, 0=evenodd
diff --git a/xps/xpscolor.c b/xps/xpscolor.c
index b0678603..1858c687 100644
--- a/xps/xpscolor.c
+++ b/xps/xpscolor.c
@@ -7,20 +7,10 @@ void
xps_set_color(xps_context *ctx, fz_colorspace *colorspace, float *samples)
{
int i;
-
- if (ctx->opacity_only)
- {
- ctx->colorspace = fz_devicegray;
- ctx->color[0] = samples[0];
- ctx->alpha = 1.0;
- }
- else
- {
- ctx->colorspace = colorspace;
- for (i = 0; i < colorspace->n; i++)
- ctx->color[i] = samples[i + 1];
- ctx->alpha = samples[0];
- }
+ ctx->colorspace = colorspace;
+ for (i = 0; i < colorspace->n; i++)
+ ctx->color[i] = samples[i + 1];
+ ctx->alpha = samples[0];
}
static int unhex(int chr)
diff --git a/xps/xpsopacity.c b/xps/xpsopacity.c
index 6bd640b3..047e213d 100644
--- a/xps/xpsopacity.c
+++ b/xps/xpsopacity.c
@@ -28,9 +28,6 @@ xps_begin_opacity(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource
{
fz_rect bbox;
float opacity;
- int save;
-
-return;
if (!opacity_att && !opacity_mask_tag)
return;
@@ -38,23 +35,13 @@ return;
opacity = 1.0;
if (opacity_att)
opacity = atof(opacity_att);
-// gs_setopacityalpha(ctx->pgs, opacity);
xps_bounds_in_user_space(ctx, &bbox);
+ ctx->dev->beginmask(ctx->dev->user, bbox, 0, fz_devicegray, &opacity);
if (opacity_mask_tag)
- {
- /* opacity-only mode: use alpha value as gray color to create luminosity mask */
- save = ctx->opacity_only;
- ctx->opacity_only = 1;
-
- // begin mask
xps_parse_brush(ctx, ctm, base_uri, dict, opacity_mask_tag);
-
- ctx->opacity_only = save;
- }
-
- // begin group
+ ctx->dev->endmask(ctx->dev->user);
}
void
@@ -63,5 +50,6 @@ xps_end_opacity(xps_context *ctx, char *base_uri, xps_resource *dict,
{
if (!opacity_att && !opacity_mask_tag)
return;
- // end mask+group
+
+ ctx->dev->popclip(ctx->dev->user);
}
diff --git a/xps/xpszip.c b/xps/xpszip.c
index 5528f0f7..069c83ea 100644
--- a/xps/xpszip.c
+++ b/xps/xpszip.c
@@ -498,11 +498,6 @@ xps_new_context(void)
ctx->start_part = NULL;
- ctx->use_transparency = 1;
- if (getenv("XPS_DISABLE_TRANSPARENCY"))
- ctx->use_transparency = 0;
-
- ctx->opacity_only = 0;
ctx->fill_rule = 0;
return ctx;