Quartz fixes

View: New views
4 Messages — Rating Filter:   Alert me  

Quartz fixes

by Andrea Canciani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here is a patchset to improve the quartz backend. In particular:
0001 fixes pattern painting, as the ctm was changed and not restored.
This can be easily seen in surface-pattern-operator
0002 improves pure-alpha images by using them as masks. This makes
them behave more correctly (as proved by alpha-similar), but
compositing of alpha masks is not fixed by this patch, thus clipping
upon fallback (which relies on IN compositing of pure-alpha similar
surfaces) is not fixed by this one.
0003 fixes nothing, just some code cleanup. Avoids some useless
allocations, align stride as suggested.
0004 fixes compositing of pure-alpha surfaces over coloured surfaces.
Quartz considers them as if they had no colour information, but cairo
requires pure-alpha surfaces to have a "default" black colour
0005 fixes the "unbounded fixup" when stroking. Stroking a dashed path
or a path with (non-identity) transformations was incorrectly fixed
up. See the change in clip-stroke-unbounded (note: this patch alone
doesn't completely fix it as there are also some issues with
compositing)
0006 fixes EXTEND_NONE surface sources when using an operator that is
not surface-bounded. Once more, see surface-pattern-operator (but also
many other tests, like operator-source, whose quartz reference files
are broken)
0007 fixes SATURATE and the blending operators for coloured surfaces
and add special handling for pure-alpha surfaces. Seeclip-operator,
operator, operator-alpha, extended-blend and (if you have it)
operator-alpha-alpha

Please notice that some quartz reference files are broken. I compared
directly to the generic reference in some cases to check if there were
visible differences.

I tried to keep the patches "independent" as in "any subset can be
pushed without requiring the rest", but of course the results of the
combination are different than what happens when applying each one
alone (expecially for 0002 and 0007)
No patch alone fixes everything, but altogether they address many
issues in this backend, in particular they fix clipping in fallback
paths (which I'm hitting since I'm not using quartz-font).
Without these patches text rendering fails in most cases and "new"
blending modes produce incorrect results.
Please review
Thank you
Andrea Canciani








_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

0001-quartz-Fix-pattern-painting.patch (1K) Download Attachment
0002-quartz-Improve-A8-image-handling.patch (2K) Download Attachment
0003-quartz-Improve-unbounded-operators-fixup.patch (2K) Download Attachment
0004-quartz-Fix-compositing-of-alpha-only-surface-sources.patch (1K) Download Attachment
0005-quartz-Fix-stroking-with-unbounded-operator.patch (5K) Download Attachment
0006-quartz-Fix-source-unbounded-compositing-of-surface-s.patch (6K) Download Attachment
0007-quartz-Fix-compositing-operators.patch (14K) Download Attachment

Re: Quartz fixes

by Andrea Canciani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here is one more patch and a lot more comments.
Hopefully all the interesting information about each patch is now in
the commit message.
The main interactions are:
 - 0004 does nothing at all unless 0002 is applied (it changes the
colour of pure-alpha masks, but A8 images are greyscale images before
0002)
 -  0002 and 0007 together make A8 compositing work (neither would do
alone, as without 0002 they would be composited as opaque greyscale
images and without 0007 the backend would use the wrong operators)
 - 0005 have an almost hidden (I wrote about it in the commit message)
side-effect: I changed the stroke fix to setup the source when the CTM
hasn't been changed, so 0005 fixes the fallback (as it guarantees
_cairo_quartz_setup_fallback_source is always called with the base
CTM)
0008 and 0003 are just code cleanup, they should make no difference
regarding the correctness of the backend, just improve code (and maybe
performance, but I didn't test it at all)
Credit for 0001 and 0008 goes to Robert O'Callahan.
Please review and comment
Andrea Canciani









_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

0001-quartz-Fix-gradient-pattern-painting.patch (1K) Download Attachment
0002-quartz-Improve-A8-image-handling.patch (3K) Download Attachment
0003-quartz-Improve-unbounded-operators-fixup.patch (2K) Download Attachment
0004-quartz-Fix-implied-colour-of-alpha-only-surface-sour.patch (1K) Download Attachment
0005-quartz-Fix-stroking-with-unbounded-operator.patch (5K) Download Attachment
0006-quartz-Fix-source-unbounded-compositing-of-surface-s.patch (7K) Download Attachment
0007-quartz-Fix-compositing-operators.patch (15K) Download Attachment
0008-quartz-Cleanup-fallback-source.patch (2K) Download Attachment

Re: Quartz fixes

by Robert O'Callahan-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Nov 10, 2009 at 1:49 PM, Andrea Canciani <ranma42@...> wrote:
Credit for 0001 and 0008 goes to Robert O'Callahan.

Thanks for submitting them!

Rob
--
"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]

_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo

Re: Quartz fixes

by Chris Wilson-11 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Excerpts from Andrea Canciani's message of Tue Nov 10 00:49:26 +0000 2009:
> Here is one more patch and a lot more comments.
> Hopefully all the interesting information about each patch is now in
> the commit message.
Excellent! I was able to follow the series and understand why you were
making the changes even though I have no knowledge of Quartz.

> Credit for 0001 and 0008 goes to Robert O'Callahan.

Just a minor quibble here: if you have not made any substantial changes
to the patch and are essentially just committing someone else's work (even
with an extended commit log), please use
  git commit --author="Robert O'Callahan <robert@...>"
to properly attribute the authorship in our history. (You will still be
tracked as the committer of the change.)

[Hey Robert, are you going to submit a patch to update AUTHORS? ;-]

Other than that, I think they are ready to be pushed to be master. Are
you ready for such responsibility? :-)

Many thanks,
-ickle
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
cairo mailing list
cairo@...
http://lists.cairographics.org/mailman/listinfo/cairo