summaryrefslogtreecommitdiff
path: root/xps/xpsopacity.c
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2012-02-21 11:30:58 -0800
committerMichael Vrhel <michael.vrhel@artifex.com>2012-02-24 16:34:13 -0800
commit2c4aa5f1a90ee03aacce58f24b819cab3bdd1625 (patch)
tree7e3e698e86d1973eda682a165250758e507b3a11 /xps/xpsopacity.c
parent77a8045048a4aaa727f700187816170d7fbd072c (diff)
Fix for bug 692865. Make XPS interpreter use ICC color spaces for default
The XPS interpreter was still using Device color spaces for its default color spaces. This fix has it use ICC color spaces by default which is required by the spec. This revealed an issue with the color space handling of the opacity masks. These were getting drawn in sRGB color space but the transparency group is linear gray. Since we are drawing the opacity mask as a luminosity mask that is gray we ended up mapping through a nonlinearity.
Diffstat (limited to 'xps/xpsopacity.c')
-rw-r--r--xps/xpsopacity.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xps/xpsopacity.c b/xps/xpsopacity.c
index 9545a610b..65f69864b 100644
--- a/xps/xpsopacity.c
+++ b/xps/xpsopacity.c
@@ -57,9 +57,10 @@ xps_begin_opacity(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
if (opacity_mask_tag)
{
gs_trans_mask_params_init(&tmp, TRANSPARENCY_MASK_Luminosity);
+ gs_gsave(ctx->pgs);
+ gs_setcolorspace(ctx->pgs, ctx->gray_lin);
gs_begin_transparency_mask(ctx->pgs, &tmp, &bbox, 0);
- gs_gsave(ctx->pgs);
/* Need a path to fill/clip for the brush */
gs_moveto(ctx->pgs, bbox.p.x, bbox.p.y);
@@ -81,8 +82,8 @@ xps_begin_opacity(xps_context_t *ctx, char *base_uri, xps_resource_t *dict,
return gs_rethrow(code, "cannot parse opacity mask brush");
}
- gs_grestore(ctx->pgs);
gs_end_transparency_mask(ctx->pgs, TRANSPARENCY_CHANNEL_Opacity);
+ gs_grestore(ctx->pgs);
ctx->opacity_only = save;
}