<div dir="ltr">Yes, I do wonder if I'm falling off of the slow path. Unfortunately the whole rendering system is a bit .. sprawling, and impractical to show everything. I'll try to show the relevant calls though.<br>
<br>For clipping, we are using cairo_rectangle/cairo_clip, with aligned coordinates (although I need to verify that the alignment is working, I suppose). When rendering the text, here's what the code looks like:<br><br>
cairo_set_operator cr, CAIRO_OPERATOR_OVER);<br> cairo_set_source_rgba(cr, red, green, blue, alpha);<br><br> pixel_align_for_fill(cr, &x, &y);<br> cairo_set_font_size(cr, font_size_pixels);<br> maybe_throw_cairo_error(cr, "cairo_set_font_size");<br>
<br> cairo_move_to(cr, x, y);<br> cairo_show_text(cr, str_as_utf8);<br><br>For my testing, I haven't set any other text properties, so it's the default font face & options. Alignment is handled by transforming to device, rounding to integral values, and transforming back to user space.<br>
<br>(I wouldn't be surprised if my method of getting the results on-screen is also a bottleneck, since the app is double-buffered and I haven't done any performance testing of the copy yet. But right now I'm measuring the text rendering itself.)<br>
<br>I really hope there's something I can do, because Cairo is, in all other respects, awesome. It's the best 2D API I've ever used, easily.<br><br>Thanks for your time,<br><br>Damian<br><br><br><div class="gmail_quote">
On Tue, Aug 26, 2008 at 5:23 AM, Gerdus van Zyl <span dir="ltr"><<a href="mailto:gerdusvanzyl@gmail.com">gerdusvanzyl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Please see this discussing on the list:<br>
<br>
<a href="http://lists.cairographics.org/archives/cairo/2008-February/012982.html" target="_blank">http://lists.cairographics.org/archives/cairo/2008-February/012982.html</a><br>
<br>
The reason I saw slow rendering was with the way I did double<br>
buffering and the type of surface I created. If you could show us your<br>
text rendering code it would be informative.<br>
<font color="#888888"><br>
~Gerdus<br>
</font><div><div></div><div class="Wj3C7c"><br>
On Tue, Aug 26, 2008 at 11:40 AM, Nicholas Allen <<a href="mailto:allen@ableton.com">allen@ableton.com</a>> wrote:<br>
> -----BEGIN PGP SIGNED MESSAGE-----<br>
> Hash: SHA1<br>
><br>
> I also experience serious performance problems with Cairo. I have only<br>
> run on Windows but it's performance is so bad as to make it completely<br>
> unusable for what we need. It's a shame because the API is really<br>
> clean and the output looks great. Hopefully, this will get fixed in<br>
> future releases...<br>
><br>
> Nick<br>
><br>
> Damian Frank wrote:<br>
>> I'm pretty new to Cairo, and I've been looking at using it for a<br>
>> codebase that currently uses, variously, Xlib, GDI, GDI+, and<br>
>> Quartz, among others. Performance is one of my chief concerns,<br>
>> though. At the moment I'm looking at text performance, and I have<br>
>> some serious concerns. For now, I am just benchmarking on Windows,<br>
>> and only for to-screen rendering (as opposed to printing or<br>
>> PS/PDF/etc).<br>
>><br>
>> Can someone give me some pointers on staying on the fast code paths<br>
>> for text rendering on win32? My tests so far show image and DDB<br>
>> both taking about 15-20x as long as our GDI implementation, and<br>
>> 24-bit DIB taking about 5x as long.<br>
>><br>
>> Thanks,<br>
>><br>
>> Damian<br>
>><br>
>><br>
>> ----------------------------------------------------------------------<br>
>><br>
>><br>
>> _______________________________________________ cairo mailing list<br>
>> <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
>> <a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br>
><br>
> -----BEGIN PGP SIGNATURE-----<br>
> Version: GnuPG v1.4.7 (MingW32)<br>
> Comment: Using GnuPG with Mozilla - <a href="http://enigmail.mozdev.org" target="_blank">http://enigmail.mozdev.org</a><br>
><br>
> iD8DBQFIs8+jbpmWsXfOU58RAhUdAJ9ZvO339sJmJFpaIKaTLDbHEATLngCeK9zT<br>
> AoOUaWptYxAJZE5kIii1Whc=<br>
> =kDzx<br>
> -----END PGP SIGNATURE-----<br>
><br>
</div></div>> _______________________________________________<br>
<div class="Ih2E3d">> cairo mailing list<br>
> <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
> <a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br>
><br>
</div>_______________________________________________<br>
<div><div></div><div class="Wj3C7c">cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br>
</div></div></blockquote></div><br></div>