shadow7 / androidsvg

Automatically exported from code.google.com/p/androidsvg
0 stars 0 forks source link

Provide copy constructor or allow rendering to multiple viewBox at once #56

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm trying to render different parts of the same SVG on different threads. The 
rendering is working fine, but is very slow. In order to speed it up, I've had 
to create several SVG instances from the same asset to use across the threads. 
I am guessing that creating these is slowed down a lot by having to re-parse 
the SVG file...

So I see two solutions...
1. a copy constructor, preventing re-parsing of the SVG file. But still causing 
me to have to alloc the same objects 2/3/4 times.
2. allow different parts of the same SVG to be rendered simultaneously, 
specifying a viewBox/viewPort in the render call. This could essentially use 
the same interface as "renderViewToCanvas()" but allow you to pass in a view. 
(OR allow views to be dynamically added!)

Obviously option 1 is the quick and dirty way, with 2 being the more complex. I 
am not familiar with your code base so I can't gauge how easy 2 would be...

"Why don't you break you SVG file up?"
I don't know the parts I require ahead of time, I'm rendering tiles of a map.

"Why don't you add 'views' into the SVG?"
As above.

What version of the product are you using? On what operating system?
1.2.1 and 1.2.2-beta-1

Original issue reported on code.google.com by sd...@airsource.co.uk on 19 Mar 2015 at 2:16