Http://www.cnblogs.com/TerryBlog/archive/2012/03/02/2377251.html
Renderscript is a low-level, high-performance programming language for 3D rendering and processing intensive computing (3D playback, and CPU-intensive computing). Android has consistently fared poorly in drawing performance and has improved since the introduction of the NDK, while the Renderscript has been released in Honeycomb after the framework, greatly increasing the execution and computing power of the Android native language. Here are some of the online summaries:
Programming Languages and portability
Renderscript uses the C99 syntax (Standard C comes from 1999, the latest standard is C11, from 2011), and the new Application Programming Interface (API) is eventually compiled into native code. This means that as Android graphics developers will have to learn a system of the API, because its API is not everyone knows, and Google for Renderscript this aspect of the document is very few.
Renderscript can't be ported from other C apps, but it's more common on Android devices than the NDK. Compared to the NDK portability is weaker, remember that the previous transplant of a C program called Cadaver WebDAV client is the use of the NDK, so this is the Renderscript portability can be said to be improved.
Compiling and debugging
Renderscript the first-pass compilation on the machine and then the last-pass compilation on the target device (Just-in-time compiling), resulting in more efficient native binary code. This means that any device that supports Renderscript can run your code. Don't care what architecture.
Currently, the code brought by Renderscript can only be run on the main processor, and it will automatically generate code that can take advantage of multiple cores if there are multiple cores on the device. As a result, the compiled program is optimized for the machine, which solves the device fragmentation, which means that developers no longer have to worry about the user's phone, tablet is not good enough, there is no GPU ... And so on, it's all given to Renderscript to worry about. No Gpu,renderscript write the program to the CPU to deal with (the compiler behind the technology is actually used LLVM).
Performance
Renderscript has a cuda-like compute API for calculation, configuration and setup is relatively easy. The final run speed is actually better than the NDK implementation, which requires less code to write. Renderscript is best suited for 3D user interfaces or high-performance computing tasks. As the above compilation and debugging say, with the last pass of the compilation can be directly or by the hardware to improve performance.
At last
Introducing Renderscript is not a substitute for the NDK, but a choice for developers.
How to learn?
About the official documents
Http://developer.android.com/guide/topics/renderscript/index.html This is the official Renderscript homepage
http://developer.android.com/guide/topics/renderscript/graphics.html Knowledge of graphics
http://developer.android.com/guide/topics/renderscript/compute.html Knowledge of Computing
A relatively good developer's blog abroad, currently only two articles:
http://blog.iangclifton.com/2011/08/24/renderscript-101-part-1-renderscript-basics-tutorial/
http://blog.iangclifton.com/2011/08/24/renderscript-101-part-2-renderscript-interaction/
And how do the functions inside the RS file look?
4.0 please find the appropriate header file in the framework here:
FRAMEWORKS/BASE/LIBS/RS/SCRIPTC, this contains the following header files
Rs_allocation.rsh Rs_atomic.rsh rs_cl.rsh rs_core.rsh rs_debug.rsh rs_graphics.rsh rs_math.rsh Rs_matrix.rsh rs_ob Ject.rsh Rs_quaternion.rsh Rs_time.rsh Rs_types.rsh
Or it can be found under the platform of the SDK.
The corresponding document is below:
A detailed description of the Android Renderscript and some useful documentation