almosr / android-svg-code-render

Convert SVG files into Java source and use it in your Android app
Apache License 2.0
24 stars 3 forks source link

Is the drawing result GPU hardware acelerated? #74

Closed trusktr closed 7 years ago

trusktr commented 7 years ago

?

almosr commented 7 years ago

In short: depends on the SVG file you want to render to the screen and also on the Android OS version.

Bit longer: The generated code is using completely standard Android OS drawing functions, but not all of these functions are available in HW accelerated form on all Android versions. Here is a link which describes the details.

What you could do: check the methods in the generated code whether everything is supported on the minimum OS version what you want to support. Or simply test the generated code on that OS version and check if there was any issue with the rendering while HW acceleration is on.

My experience is that most of the files I converted were working with HW acceleration, but I was aiming for Jelly Beans as minimum OS version, so YMMV.

Even if HW acceleration is off, rendering will be significantly faster compared to any other methods I know.

trusktr commented 7 years ago

Ah, interesting. Thanks! I am doing some research. Some other libraries that accelerate SVG drawing:

almosr commented 7 years ago

I guess it depends on the SVG file, but mostly processing SVG structure is significant effort, rendering is not the bottleneck. Also don't forget about the memory consumption, parsing XML and creating various objects which are necessary for drawing on-the-fly has a massive impact.

You could give it a try and compare the results across various libraries. If you do so would you please share the results with us? Thanks.

almosr commented 7 years ago

I have created this improvement for a minimum Android OS version parameter: #75