poppler/CairoOutputDev.cc | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
New commits: commit 0af1ae75fd4c8031343f668bed5d8ca6588ee652 Author: Carlos Garcia Campos <[email protected]> Date: Tue Jan 26 20:49:17 2010 +0100 [cairo] Use the right matrix for the mask in drawMaskedImage() Fixes bug #16906. diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 331b5ac..5ca86b8 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -1850,6 +1850,7 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_surface_t *maskImage, *image; cairo_pattern_t *maskPattern, *pattern; cairo_matrix_t matrix; + cairo_matrix_t maskMatrix; Guchar *pix; int x, y; int invert_bit; @@ -1933,9 +1934,11 @@ void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, cairo_matrix_init_translate (&matrix, 0, height); cairo_matrix_scale (&matrix, width, -height); - cairo_pattern_set_matrix (pattern, &matrix); - cairo_pattern_set_matrix (maskPattern, &matrix); + + cairo_matrix_init_translate (&maskMatrix, 0, maskHeight); + cairo_matrix_scale (&maskMatrix, maskWidth, -maskHeight); + cairo_pattern_set_matrix (maskPattern, &maskMatrix); cairo_save (cairo); cairo_set_source (cairo, pattern); commit d8ceaff39f5b80624b6bdc703c2a180dfc3d73ee Author: Carlos Garcia Campos <[email protected]> Date: Tue Jan 26 11:57:06 2010 +0100 [cairo] Add some more LOG messages diff --git a/poppler/CairoOutputDev.cc b/poppler/CairoOutputDev.cc index 5658df0..331b5ac 100644 --- a/poppler/CairoOutputDev.cc +++ b/poppler/CairoOutputDev.cc @@ -774,6 +774,8 @@ GBool CairoOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, else cairo_pattern_set_extend (fill_pattern, CAIRO_EXTEND_PAD); + LOG (printf ("axial-sh\n")); + // TODO: use the actual stops in the shading in the case // of linear interpolation (Type 2 Exponential functions with N=1) return gFalse; @@ -804,6 +806,8 @@ GBool CairoOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shadin else cairo_pattern_set_extend (fill_pattern, CAIRO_EXTEND_NONE); + LOG (printf ("radial-sh\n")); + return gFalse; } @@ -1105,6 +1109,9 @@ void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, double * /*bbo css->knockout = knockout; css->next = groupColorSpaceStack; groupColorSpaceStack = css; + + LOG(printf ("begin transparency group. knockout: %s\n", knockout ? "yes":"no")); + if (knockout) { knockoutCount++; if (!cairo_shape) { @@ -1142,11 +1149,12 @@ void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, double * /*bbo } void CairoOutputDev::endTransparencyGroup(GfxState * /*state*/) { - if (group) cairo_pattern_destroy(group); group = cairo_pop_group (cairo); + LOG(printf ("end transparency group\n")); + if (groupColorSpaceStack->next && groupColorSpaceStack->next->knockout) { if (shape) cairo_pattern_destroy(shape); @@ -1157,6 +1165,8 @@ void CairoOutputDev::endTransparencyGroup(GfxState * /*state*/) { void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, double * /*bbox*/) { cairo_set_source (cairo, group); + LOG(printf ("paint transparency group\n")); + if (!mask) { //XXX: deal with mask && shape case if (shape) { @@ -1213,6 +1223,8 @@ void CairoOutputDev::setSoftMask(GfxState * state, double * bbox, GBool alpha, Function * transferFunc, GfxColor * backdropColor) { cairo_pattern_destroy(mask); + LOG(printf ("set softMask\n")); + if (alpha == false) { /* We need to mask according to the luminocity of the group. * So we paint the group to an image surface convert it to a luminocity map @@ -2171,6 +2183,8 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, } gfree(lookup); + LOG (printf ("drawImage %dx%d\n", width, height)); + cairo_surface_t *scaled_surface; scaled_surface = downscaleSurface (image); @@ -2189,8 +2203,6 @@ void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, if (cairo_pattern_status (pattern)) goto cleanup; - LOG (printf ("drawImage %dx%d\n", width, height)); - cairo_pattern_set_filter (pattern, interpolate ? CAIRO_FILTER_BILINEAR : CAIRO_FILTER_FAST); _______________________________________________ poppler mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/poppler
