Bug 13065 - Problem when drawing surface to translated context
Summary: Problem when drawing surface to translated context
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: quartz backend (show other bugs)
Version: 1.5.3
Hardware: Other All
: medium normal
Assignee: Vladimir Vukicevic
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-02 16:33 UTC by Richard Hult
Modified: 2008-04-05 02:14 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Test case (3.13 KB, text/plain)
2007-11-02 16:35 UTC, Richard Hult
Details
Screenshot (29.28 KB, image/png)
2007-11-02 16:36 UTC, Richard Hult
Details
alternate test case (2.36 KB, text/x-csrc)
2007-12-03 15:52 UTC, Brian Ewins
Details

Description Richard Hult 2007-11-02 16:33:49 UTC
While debugging an issue with GTK+ on quartz I think I ran into a bug. The problem is that drawing with a surface as source into a context, when the context is translated, seems to offset the source. I will attach a test case and a screenshot. The same code works on X11 (I have taked it from GTK+, the color selector code and simplified it a bit). The problem appears both on 1.4.x and 1.5.x.
Comment 1 Richard Hult 2007-11-02 16:35:47 UTC
Created attachment 12322 [details]
Test case
Comment 2 Richard Hult 2007-11-02 16:36:42 UTC
Created attachment 12323 [details]
Screenshot

The screenshot shows the example with and without the translate call.
Comment 3 Richard Hult 2007-11-03 06:22:51 UTC
I've heard that this is working fine with 1.4.4, but not 1.4.10 or 1.5.x.
Comment 4 Brian Ewins 2007-12-03 15:52:27 UTC
Created attachment 12920 [details]
alternate test case

Had a look at this, hacked your test case into the rel-path test and minimizing a bit further. Interestingly it seems that the test works correctly (quartz=image) when the stroke is changed to a fill, points to a bug in the stroke code with DO_IMAGE path (which was new in the timeframe you mention). I think what's going on is that the stroke_transform and the sourceImageTransform are both being applied and they both contain the ctm.

I'll see if I can come up with a fix.
Comment 5 Richard Hult 2008-04-05 02:14:52 UTC
This was fixed by:

commit ae143d779ba5765f55754cb89af87b065d84ef04
Author: Vladimir Vukicevic <vladimir@pobox.com>
Date:   Tue Mar 25 11:17:57 2008 -0700

    [quartz] When stroking with an image source, use the right CTM for the image
    
    Since the CTM was modified for the stroke transform, we need to reset
    it before calling ConcatCTM for the source transform.




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.