[cairo] Write ups on Microsoft Avalon

Carl Worth cworth at east.isi.edu
Thu May 13 06:29:55 PDT 2004


On Thu, 13 May 2004 03:46:09 -0600, "Ravindra Kumar" wrote:
> Following is a list of few such things that we
> need in Mono but these seem to be missing in Cairo.

Thanks for your feedback. It looks quite useful. I'll do my best to
address each issue you've raised.

>    - setting for on/off antialiasing [1]

I'll address the below.

>    - support for user-created/built-in start and end line caps

There's too much possible variety here, (one soon gets to arrowheads
with infinite variations), for this to belong inside cairo itself. But
it shouldn't be too hard to do everything at the layer above cairo.

One thing that is missing that may be needed is the cairo_stroke_path
function. This function will compute a path that, if filled, would
create the same result as a stroke of the current path. This function
would allow you to then add your custom caps to the path, but still fill
the entire result in a single operation. That's important to do so that
you don't get seams when dealing with translucent paths for example.

The support for cairo_stroke_path is near the top of the TODO list, and
I actually have most of the work done for it. However, this code does a
fine job of exposing problems in the current polygon tessellation
implementation. So we need to fix that before we can commit
cairo_stroke_path.

>    - setting for dash cap

What do you mean by this one?

>    - setting for gamma correction [2]

Gamma-correct composited is still missing in the backends that cairo
uses, (eg. Render). And that is an issue that does need to be addressed
eventually. On the TODO already.

>    - support for metafile

I'm not quite sure what you mean by this either. What would you like to
see cairo provide?

> [1], to draw something without antialiasing, once you suggested me to
> do it pixel by pixel manually. Sorry, I could not give it a try yet,
> but would try it sometime once I'm done with other things.

Heh, I didn't seriously intend for you to implement that. What I meant
was that the only way I could think of to achieve the effect of
pixelized rendering in cairo would be to carefully construct a path that
outlined each pixel. That would be quite slow to render, and it would
ugly be design. I can't imagine that would be a useful exercise.

The question to ask yourself is what you really want. If you are
implementing a pixel-perfect specification that demands that result,
then that may be the kind of approach you would have to take.

But my guess would be that "turn off anti-aliasing" is probably intended
to mean "I'm willing to sacrifice rendering quality in exchange for
speed" in which case the approach above would have the opposite effect
from what was desired. We do already have cairo_set_tolerance which does
allow a quality/speed tradeoff, (though I haven't tried to see how much
dynamic range it offers).

The right approach is probably to put effort into making cairo fast
enough that nobody ever wants to bother dialing down the output
quality.

-Carl




More information about the cairo mailing list