Re: GTK and lots of drawings



Hello Creak,

Looks interesting. You want to build some kind of "wily introscope" (e.g. http://connectimages.ca.com/sc/kbimages/604642b.gif ) :)
My suggestion to a possible optimization is to avoid, probably rendering of parts that are not visible currently (so you can render them later). In theory you can try to draw them in parallel, and then copy to the canvas when all parts are ready. And also, maybe you can optimize the drawing if you do not render very-very thin parts as the rectangle, but as a line (without the text, until you zoom it).

Kind regards,
Vest


On Sat, Aug 2, 2014 at 4:55 PM, Romain Failliot <romain failliot foolstep com> wrote:
Hi Vest,

Thanks for your reply.
Actually, I'm currently doing my drawings using Cairo, and it work
pretty well. But when there is a lot of drawings (like around 200,000
I'd say), it begins to slow down. So I was looking around to see
what's the best solution for what I'm doing.

I've read this article from GUADEC 2014:
http://www.bassi.io/articles/2014/07/29/guadec-2014-gsk/
I understood there that Clutter is not a tool that should be used for
drawing. Compositing: yes; drawing: no ;)

So I think I'll do as you said: I'll keep Cairo and simply try to find
the most optimized way to draw all these little rectangles. Since I'll
try to do a responsive interface, I don't think I could bufferize the
whole drawing into an image, because depending where the user is
pointing, the drawing beneath the pointer can change, so the image
will change all the time anyway, so the buffering won't be very
efficient.

If you want, you'll find screenshots of what I'm doing here:
https://plus.google.com/photos/+RomainFailliot/albums/5994060420563947665/5994061265644646130?pid=5994061265644646130&oid=111931671734626727541
In these screenshots the drawing is pretty fast, but sometime there
can be a lot more "benches" to draw and that's where it gets
complicated.
There's also the source code: https://github.com/MightyCreak/libbench

Thanks again for your help!
Creak

2014-08-02 6:14 GMT-04:00 Vest . <vest 84 gmail com>:
> Hello Creak,
>
> Actually, the clutter is not a toolkit for drawing only. It allows you to
> create 2d/3d user interfaces using images that you provide.
> Yes, you can display actors that have the image drawn at runtime, e.g.
> extract the Cairo context or use cogl. Some of good examples are available
> here: http://github.com/clutter-project/toys
>
> My suggestion to you is to choose, e.g. Cairo toolkit and create an image in
> memory, and then when the image is ready, simply copy it to the window
> (https://developer.gnome.org/gtk3/3.0/gtk-getting-started.html search for
> Cairo).
>
> What do you think?
>
> Kind regards,
> Vest



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]