Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
GoogleCodeExporter opened this issue Jul 24, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

So basically you are asking for a version of renderViewToX() where you pass in 
a viewBox instead of a viewId?

Have you tried using setDocumentViewBox() before rendering to change which 
parts of the SVG get rendered?  It should be pretty much equivalent to what you 
are asking.

Original comment by paul.leb...@gmail.com on 24 Mar 2015 at 12:08

@GoogleCodeExporter
Copy link
Author

Actually that won't be thread safe, so it isn't a workable solution.

Original comment by paul.leb...@gmail.com on 24 Mar 2015 at 12:09

@GoogleCodeExporter
Copy link
Author

>So basically you are asking for a version of renderViewToX() where you pass in 
a viewBox instead of a viewId?

Yes, that would be the ideal solution.

Actually that won't be thread safe, so it isn't a workable solution

Yea, that's what I found unfortunately. Therefore I'm constructing several SVG 
objects to render different view boxes in different threads. Any speed up to 
the construction of the SVG objects would be a great start (e.g. via a copy 
constructor)

Original comment by samduke...@gmail.com on 28 Mar 2015 at 7:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant