Bug 10036

Summary: nquartz surface does not scale line widths
Product: cairo Reporter: Brian Ewins <Brian.Ewins>
Component: quartz backendAssignee: Carl Worth <cworth>
Status: RESOLVED FIXED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium CC: hugo.vincent
Version: 1.3.15   
Hardware: Other   
OS: Mac OS X (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: patch fixing the problem in a minimalist way.
updated patch.
updated patch after nquartz renamed to quartz.
fixes patch up to pass text-rotate test
reverting to a previous version of patch after bugfix

Description Brian Ewins 2007-02-19 18:14:20 UTC
(this is against nquartz, not quartz, but theres no component yet)

The bug is easy to reproduce - just run the line-width-scale test. Apparently this bug is biting the Joost folks. 

The reason for the bug is that line width scaling is done in cairo-path-stroke.c, not used in nquartz, while all of the points used in paths are scaled in cairo-gstate. 

A patch follows which undoes the point scaling then draws the paths applying the scale to the CGContext. However some paths that hit this code don't provide the matrices required. A better fix (?) might be to store the points in the path in user space, at least for nquartz. I'm not proposing that here as its much more disruptive.
Comment 1 Brian Ewins 2007-02-19 18:18:47 UTC
Created attachment 8781 [details] [review]
patch fixing the problem in a minimalist way.

This makes a couple of tests pass, but the code paths where I use the identity matrix look super-suspicious; I can't fix those without much larger changes, but then, I don't know what tests they cause to fail (if any).
Comment 2 Brian Ewins 2007-02-20 09:35:01 UTC
It seems that a very similar patch was already reviewed and applied to the pdf surface backend:
http://lists.freedesktop.org/archives/cairo/2006-April/006740.html
this commit:
http://gitweb.freedesktop.org/?p=cairo;a=commit;h=8d635a3aa967b16de5047eceadf3d350d1169a76

Since Carl ok'd that patch, this one can't be as bad as I thought :) I'll massage it into the same shape (nulls instead of identity matrices, consistent names, etc) and push that tonight if Vlad gives it the ok.
Comment 3 Brian Ewins 2007-02-20 17:53:06 UTC
Created attachment 8795 [details] [review]
updated patch.

This patch is more like the one applied to the pdf surface, and is updated now that the nquartz surface has been renamed.
Comment 4 Brian Ewins 2007-03-06 16:17:45 UTC
Created attachment 9001 [details] [review]
updated patch after nquartz renamed to quartz.

this is the same patch as before, just brought up to date again.
Comment 5 Hugo Vincent 2007-03-16 18:36:37 UTC
*** Bug 10141 has been marked as a duplicate of this bug. ***
Comment 6 Brian Ewins 2007-03-25 10:25:34 UTC
Created attachment 9282 [details] [review]
fixes patch up to pass text-rotate test

The previous version of the patch produced incorrect results when the ctm contained rotation, eg the text-rotate test. This version fixes that up. The only test still looking odd is skew-extreme, which now has lines with the correct widths but apparently incorrect offsets.
Comment 7 Brian Ewins 2007-03-25 14:49:28 UTC
Created attachment 9292 [details] [review]
reverting to a previous version of patch after bugfix

The reason why the original patch messed up on rotation/skew was due to a typo elsewhere in the code, fixed in commit c8e37af4b06fffe1aa1a1c3d2cd6481cc2cf8938.

With this patch quartz now passes the line-width, line-width-scaled and skew-extreme tests.
Comment 8 Brian Ewins 2007-11-15 10:17:32 UTC
This was fixed back in March.

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.