On Wed, 26 Apr 2000, James Henstridge wrote:

> On Tue, 25 Apr 2000, Alexander Larsson wrote:
> > Caching of SVPs is essential for performance of libart-based
> > renderers. GnomeCanvas supports this by embedding libart-specific code in
> > all items. I can't see any way to do this except the DiaShape style of
> > renderer. What do you suggest?
> 
> I agree that we need some form of renderer specific caching for certain
> renderers.  If we are going to use the DiaShape idea, maybe we should also
> add some method of storing DiaShapes with the renderer (probably keyed by
> the canvas item's address and some string).

That would be one way of solving it. Although getting the shape from the
renderer would mean at least a hashtable lookup, so getting several shapes
from the renderer would be inefficient. Another solution would be to be
able to "attach" a view-specific part of the item-data to the view, which
could then be passed to the "render" method (and others, plus the
possibility to retrieve it from the view). In this data (a pointer to a
item-dependent structure) the item could store the DiaShapes and other
view-specific data it needs.

There would of course need to be some way for a view to invalidate all
items DiaShapes, when the Renderer changes zoom, or the renderer type is
changed. This would be the normal "update_data" thing that all dia objects
have.

> I think this was a bit of a misunderstanding on my part.  The canvas items
> should only ever have to worry about canvas units.  The conversion to
> paper or screen units is really an implementation dependent concern.

 Yes. I think we're in sync now.

/ Alex


Reply via email to