You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by JAMES SHAW <he...@btinternet.com> on 2005/03/11 15:28:33 UTC

Preparing GVT before display

Because rendering my SVG pages is quite
time-consuming, I would like to cache several SVG
pages in the background, and load any one of them into
a JSVGCanvas.

I'm thinking I should build a GVT tree for each SVG
doc, then feed that into JSVGCanvas.setGraphicsNode()
(though I'm not sure exactly how to do this).  Is this
where the majority of time is spent, or will I get
little speed increase?

Thanks in advance,
James Shaw

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: Preparing GVT before display

Posted by James Shaw <he...@btopenworld.com>.
Thomas DeWeese wrote:

> JAMES SHAW wrote:
>
>> Because rendering my SVG pages is quite
>> time-consuming, I would like to cache several SVG
>> pages in the background, and load any one of them into
>> a JSVGCanvas.
>>
>> I'm thinking I should build a GVT tree for each SVG
>> doc, then feed that into JSVGCanvas.setGraphicsNode()
>> (though I'm not sure exactly how to do this).
>
>
>   This would essentially be impossible (if you wanted your
> documents to retain any 'SVGness').

I don't really care what happens to the document as long as it can be 
rendered :-)

> You could preload the
> SVG documents and use the setSVGDocument call to install it.

Yes, that's what I'm currently doing.

>
>> Is this where the majority of time is spent, or will I get
>> little speed increase?
>
>
>    For most documents the majority of time is spent rendering
> the document the first time.  You can get around this by
> simply instantiating multiple JSVGCanvas's.  If you set
> the size of the canvas then when you swap it in for display
> the update will be essentially instantaneous.
>
Hmm, that possibility did occur to me.  Thanks, I might try it.
I'll have to set zoom and pan on the canvas being swapped in to match 
that canvas being swapped out, but I hope that won't be too difficult.

James Shaw

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Preparing GVT before display

Posted by Thomas DeWeese <Th...@Kodak.com>.
JAMES SHAW wrote:
> Because rendering my SVG pages is quite
> time-consuming, I would like to cache several SVG
> pages in the background, and load any one of them into
> a JSVGCanvas.
> 
> I'm thinking I should build a GVT tree for each SVG
> doc, then feed that into JSVGCanvas.setGraphicsNode()
> (though I'm not sure exactly how to do this).

   This would essentially be impossible (if you wanted your
documents to retain any 'SVGness').  You could preload the
SVG documents and use the setSVGDocument call to install it.

> Is this where the majority of time is spent, or will I get
> little speed increase?

    For most documents the majority of time is spent rendering
the document the first time.  You can get around this by
simply instantiating multiple JSVGCanvas's.  If you set
the size of the canvas then when you swap it in for display
the update will be essentially instantaneous.

    You can get a better idea of where time is spent by
turning on the 'debug' traces in the browser application.
This will emit the number of milliseconds each of the various
stages in displaying a document takes.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org