[prev in list] [next in list] [prev in thread] [next in thread]
List: cairo
Subject: Re: [cairo] Getting started
From: Mike Emmel <mike.emmel () gmail ! com>
Date: 2005-07-25 15:33:10
Message-ID: 3e90352505072508335c3f2151 () mail ! gmail ! com
[Download RAW message or body]
On 7/25/05, Vladimir Vukicevic <vladimirv@gmail.com> wrote:
> On 7/25/05, Behdad Esfahbod <behdad@cs.toronto.edu> wrote:
> > - Do not translate.
> >
> > - For drawing lines, set width to 1 and add +0.5,+0.5 to all
> > points.
>
> You don't want +0.5,+0.5 to all points though, especially not for
> horizontal/vertical lines. (See my original reply.) However, in
> thinking about it, if you use CAIRO_LINE_CAP_SQUARE (instead of the
> default BUTT), then adding +0.5,+0.5 should give you correct (and
> still fast) results.
>
> > - When drawing filled stroked rectangles, do not use the same
> > path for both fill and stroke. Use integer coordinates for the
> > fill, and half-off coordinates for the stroke. This is the only
> > way to avoid alpha-blending.
> >
> > I wish there was a way to have a fill+stroke to use the same path
> > and still be fast, but I that's only an issue with axis-aligned
> > rectangles.
>
> Yeah, this is a bit of a pain. To be more accurate, you want integer
> coordinates for fill or for even line widths, and you want offset
> coordinates for odd line widths. I don't think there's a good way
> around this though, unfortunately.
>
It looks to me that for cairo a header with some static inline
functions for setting up simple fast path drawing may help ?
At least and example of how to setup to ensure the simple/fast paths are run ?
I think it would really help people porting to cairo get there simple
code ported rapidly without experiencing a lot of slowdown. There is a
lot of experience here thats generally useful.
Mike
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic