<div class="gmail_quote">On 18 March 2012 17:46, Chris Wilson <span dir="ltr">&lt;<a href="mailto:chris@chris-wilson.co.uk" target="_blank">chris@chris-wilson.co.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div>On Sun, 18 Mar 2012 17:37:06 +0200, Christos Sotiriou &lt;<a href="mailto:csotiriou@gmail.com" target="_blank">csotiriou@gmail.com</a>&gt; wrote:<br>
&gt; My problem is that drawing is too, too slow when drawing &gt;100K rectangles.<br>
&gt; I have tried double buffering in two ways (a) by using a cairo image<br>
&gt; surface, drawing upon it and then copying the pattern to my drawing<br>
&gt; context, and (b) by using cairo&#39;s surface_create_similar() function, which<br>
&gt; supposedly uses X.<br>
&gt;<br>
&gt; I have found that drawing is simply toooooo slow, every which way.<br>
<br>
</div>My first suspicion is that you may simply be expecting too much. The<br>
fastest hardware I have can only render 2M 10x10 rectangles per second.<br>
Having said that, there are likely many tricks we can show you to improve<br>
your drawing performance, mostly to make you aware of exactly what you<br>
are asking to be drawn and to then simplify those operations until they<br>
match hardware capabilities.<br></blockquote><div><br>Dear Chris, Dear Dov, <br><br>thanks again for your replies. <br><br>I have thought through my current approach carefully, and have concluded that its weakness lies in the fact that I am drawing &gt; 100K objects &quot;live&quot;, <i>i.e. </i>whenever the window is exposed or the user zooms in/out, I use cairo to draw the double buffer image, then I copy it over to the GtkLayout window.<br>
<br>I believe it would be easier to create an cairo image surface at the maximum required resolution, and then simply scale/pan that appropriately.<br><br>Thanks,<br><br>Christos. <br></div></div><br>-- <br>--------------------------------------------------------------------------<br>

Christos P. Sotiriou<br>email: <a href="mailto:csotiriou@gmail.com" target="_blank">csotiriou@gmail.com</a><br>Cell: <a href="tel:%2B30%20697%208984%20222" value="+306978984222" target="_blank">+30 697 8984 222</a><br>