Fwd: [cairo] [PATCH] PDF: alpha-gradients; reused patterns; cairo_paint_with_alpha

Kristian Høgsberg krh at bitplanet.net
Thu Jul 27 20:02:46 PDT 2006


---------- Forwarded message ----------
From: Miklós Erdélyi <erdelyim at gmail.com>
Date: Jul 25, 2006 5:03 AM
Subject: Re: [cairo] [PATCH] PDF: alpha-gradients; reused patterns;
cairo_paint_with_alpha
To: Kristian Høgsberg <krh at bitplanet.net>


On 7/25/06, Kristian Høgsberg <krh at bitplanet.net> wrote:
> From a brief look-through, this looks like good work.  I don't think
> that the hashing is the best way to go, though.  We've discussed
> keeping a surface serial number that is bumped by the core cairo code
> everytime the contents of a surface changes.  This way you can just
> remember the surface pointer and the serial number for the version
> emitted in the PDF.  If you see the same surface again and the
> sequence number hasn't changed, just use the previously emitted
> version.  Plus it's usable by other backends who will want to do
> similar things (PS and SVG at least).   The hashing is less intrusive,
> of course, but the sequence counter is useful enough that it belongs
> in cairo core code.
I knew about this, but for Inkscape users I wanted to make a complete
patch to use for the Cairo-pdf export extension. Of course it's better
to handle surface generation numbers at a higher level but since they
hasn't been implemented yet I did this hashing thing in place of the
serial+pointer thing.
Regarding the pattern reuse code: when outputting text from Inkscape
the printing engine spits text out in little chunks, sometimes two
words in three go, and the gradient used to fill the text would be
emitted three times if the pattern weren't reused completely. So this
feature is really needed for printing with Inkscape. How should be
this feature tweaked to be acceptable as a patch?[not including the
reuse of surface_patterns with hashes of course] Later I could just
hash the pointer and serial of the surface instead of the acquired
source image from it and store the pointer and this would simply work
with the current framework.

> Also, is it possible to split the patch into a couple of smaller
> patches?  At least the smask gradient work should be possible to
> seperate from the pattern reuse code.
Ok, I will make a separate patch for the separated
stroking/non-stroking operators+alpha gradient stuff, plus one patch
for the paint_with_alpha (I plan to implement full masking support
later with an augmented operator set also) and leave out the
surface_pattern reuse code because of the above. I need to include the
use_pattern/use_gstate stuff in the first patch because otherwise
gradients won't work so I hope there's no problem with that. Can I
keep the interpolation function's reuse code in the smask gradient
patch? It would be really useful because it reduces the mess in the
output a lot.
Also, when is it planned to add the surface serial stuff?
I'm going to make these two patches today if possible but let me know
if there's any problem with them or the way I would like to separate
the bigger patch into smaller ones is not adequate in terms of feature
content.

Best regards,
miklos


More information about the cairo mailing list