Using Skia in Android NDK

两盒软妹~` 提交于 2019-12-03 11:40:30

问题


Is it true that android.graphics.* depends on the native Skia library? If so, is it possible to access the Skia library in my native C/C++ codes?


回答1:


Skia is not offered as a lib/sharedlib inside android, as its api is not guaranteed to be stable over time.

there is no sample implementation of controls in C/C++, all the widget/view sub-system is done in Java

for skia http://code.google.com/p/skia/




回答2:


Skia can be use using native c/c++ code but you need android source to build your app and generate lib<>.so and apk because its make needs external/skia/..... in Android.mk[sample code as indicated by Rishabh]

Actually I tried one sample in which i pass canvas object to my native code using JNI and drawXXX() on canvas using skia apis.

You can refer to Android graphics pipeline to understand android graphics pipleline.




回答3:


This is a minimal Android app that uses JNI and Skia to do rendering.

https://skia.googlesource.com/skia/+/master/platform_tools/android/examples/hello_skia_app/




回答4:


If you are developing using AOSP it's very simple - you can link previously built libskia.so in your NDK app



来源:https://stackoverflow.com/questions/6342258/using-skia-in-android-ndk

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!