Re: how efficient is the canvas

>  	I'm planning to use the canvas for displaying html.  Needless to
>  say, html pages can get quite big, much larger than a scrolled window.
>  Now, a number of projects manually attach scrollbars to a drawing area and
>  only draw that portion of a large pixmap that is needed, for speed and
>  memory reasons.  Does the canvas do the same thing if the viewport is
>  smaller than the canvas?  Is the canvas still efficient for very large
>  canvases (like the 5,000-15,000+ pixel sizes)?

Yes.  It uses GtkLayout internally.

>  	Also, is the canvas efficient with hundreds or even thousands of
>  text items?  Obviously they're going to take up RAM and so forth, I'm not
>  expecting the canvas to be magic, just is it reasonable to use it for
>  situations like that?  Thanks.

The canvas provides nested groups (with nested bounding boxes) for
efficiency.  For an HTML renderer in the canvas, though, I would not
use a million text items.  I would write a custom canvas item to
render HTML paragraphs or logical blocks of a similar reasonable size.
The rest of the stuff, like images, should be able to use the stock
canvas items just fine.


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