Bug 50598

Summary: images with EXTEND_PAD may get rendered at the wrong position
Product: cairo Reporter: Benjamin Berg <benjamin>
Component: pdf backendAssignee: Adrian Johnson <ajohnson>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.12.2   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch that fixes the issue, no idea how correct it is ...

Description Benjamin Berg 2012-06-01 13:03:48 UTC
Created attachment 62394 [details]
Patch that fixes the issue, no idea how correct it is ...

When an image rendered using EXTEND_PAD and clipped at the same time it may be rendered at the wrong position.
The specific usecase that happened for me was rendering part of a PDF (scanned document) into a new PDF surface using popplers render() function (not render_for_printing because of bug #44002.

I'll attach a patch that fixes the issue for me. It seems that the offset is set on the created image surface in _cairo_pdf_surface_add_padded_image_surface, however it is then not used inside _cairo_pdf_surface_add_source_surface.
Comment 1 Adrian Johnson 2012-06-02 02:35:44 UTC
I've fixed the bug with a different patch. The problem with using cairo_surface_get_device_offset internally is that images passed to the pdf backend have already had the device offset applied to the pattern matrix. And we don't want to apply the offset twice.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.