[cairo] Getting started

Owen Taylor otaylor at redhat.com
Mon Jul 25 06:17:01 PDT 2005


On Sun, 2005-07-24 at 13:46 -0400, Behdad Esfahbod wrote:

> > The reason you're getting a massive slowdown is that because with a
> > .5,.5 offset you need to blend the first and last pixel, you end up
> > going down a very slow codepath that's otherwise not needed.  (I
> > followed this path for a while looking for a similar bug in mozilla;
> > there may be a cairo bug involved that's causing additional slowdown,
> > but I didn't get that far.)
> 
> Thanks Vlad,  but I'm not sure that's quite the reason here.  As
> I said, I'm mostly drawing rectangles, and so offsetting .5, .5
> makes sense, but I'll play with it more to see wether not drawing
> any lines helps.

Presumably you don't want your rectangles all to have blurred edges -
which is what offsetting by 0.5, 0.5 will give you. (And also 
corresponding slowness)

Really, the best way to get a handle on how Cairo works is to draw
some things out on graph paper - each square of the graph paper is
a pixel, the integer coordinates are at the upper left of the square.

When you draw a line, half of the width goes on either side of the
infinitely thin line ... which is why drawing from integer coordinates
to integer coordinates with a width 1 line gives you two half-filled
lines.

Try drawing it.

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050725/d97a1d65/attachment.pgp


More information about the cairo mailing list