[cairo] Drawing to multiple surfaces, "cairo_recorder", zoom (was: Some newbie question)

Tuom Larsen tuom.larsen at gmail.com
Fri Dec 14 18:12:22 PST 2007


On Dec 15, 2007 1:22 AM, Carl Worth <cworth at cworth.org> wrote:

> On Sat, 15 Dec 2007 00:05:53 +0100, "Tuom Larsen" wrote:
> > On Dec 14, 2007 11:13 PM, Carl Worth <cworth at cworth.org> wrote:
> > > On Fri, 14 Dec 2007 22:47:40 +0100, "Tuom Larsen" wrote:
> > > > - Say an application draws to a window and optionally, if a user
> would
> > > > like to, it exports the drawing to PDF. How?
> ...
> > But the drawing would be a raster image embeded in PDF, no? Well unless
> I
> > switch to a vector surface target, as you suggest bellow?
>
> I don't follow. How else would you be generating a PDF surface other
> than using a vector surface target?


I apologize, my bad.
Let's say I'm drawing some random stuff to a window. That has two
consequences: I can't re-run the drawing in different surface since it is
different every time and from the window I have raster image which I'm using
for repainting. Now, if I copy that image surface to PDF surface it's going
to be embed as raster image, as I learned yesterday.
For example, I would generate some flowers via stochastic L-system and as I
keep going I may like some so much I export them to PDF.
On the other hand, I can draw to PDF surface in the first place, save it to
a temp file and view it in a window and if I like it I will keep that file.


>
>
> > Yes, I see, thanks. But consider this:
> > - The drawing is the result of some heavy computation - now it would
> have to
> > run twice.
>
> Or else you cache the result of that heavy compilation somehow. This
> still looks like an application-specific issue to me. It's not cairo's
> job to provide data structures to store the results of arbitrary
> computation, see?
>
> Do recall what I said earlier that the application likely has to be
> able to repaint its window anyway.
>
> Meanwhile, I don't discount that an exposed meta-surface in cairo
> would definitely be useful. I still don't think it would solve all
> such prolems in applications though. You're still going to want good
> data application-specific data structures for anything you want to
> draw.
>
> > - How to pass the targeting surface through network or pipe? (Simple,
> you
> > [I] don't. You [I] send the drawing source code.)
> > Please, I certainly don't want to exaggerate.
>
> Again, that looks like something entirely outside of cairo's scope. As
> I said previously, even if we *did* immediately expose cairo's
> meta-surface code we still wouldn't have serialization/deserialization
> code. And even if we *did* write new serialization/deserialization
> code based on the current meta-surface implementation it would likely
> not be at all efficient, (repeating copies of source surface state,
> etc.).


> Anything application-specific is going to win hands-down.
>
> -Carl
>

Thank you very, very much for your replies and patience!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20071215/bde98710/attachment.html 


More information about the cairo mailing list