diff options
author | Romain Guy <romainguy@android.com> | 2009-07-30 18:45:01 -0700 |
---|---|---|
committer | Romain Guy <romainguy@android.com> | 2009-07-30 19:11:51 -0700 |
commit | 584a375df68ed7d62b38389078c6804edf228f9c (patch) | |
tree | 62120c578d718d04a940c8b76389e1d8d7717ba0 /graphics/jni | |
parent | 1a20bae18ce05a5a141810492549d351a82f6490 (diff) | |
download | frameworks_base-584a375df68ed7d62b38389078c6804edf228f9c.zip frameworks_base-584a375df68ed7d62b38389078c6804edf228f9c.tar.gz frameworks_base-584a375df68ed7d62b38389078c6804edf228f9c.tar.bz2 |
First pass at implementing the Grass live wallpaper in RenderScript.
This change also adds second(), minute() and hour() to the RS library.
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 6f781a0..a02abca 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -586,7 +586,7 @@ static void nScriptCSetClearDepth(JNIEnv *_env, jobject _this, jfloat d) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); - LOG_API("nScriptCSetClearColor, con(%p), depth(%f)", con, d); + LOG_API("nScriptCSetClearDepth, con(%p), depth(%f)", con, d); rsScriptCSetClearDepth(d); } @@ -599,6 +599,23 @@ nScriptCSetClearStencil(JNIEnv *_env, jobject _this, jint stencil) } static void +nScriptCSetTimeZone(JNIEnv *_env, jobject _this, jbyteArray timeZone) +{ + RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); + LOG_API("nScriptCSetTimeZone, con(%p), timeZone(%s)", con, timeZone); + + jint length = _env->GetArrayLength(timeZone); + jbyte* timeZone_ptr; + timeZone_ptr = (jbyte *) _env->GetPrimitiveArrayCritical(timeZone, (jboolean *)0); + + rsScriptCSetTimeZone((const char *)timeZone_ptr, length); + + if (timeZone_ptr) { + _env->ReleasePrimitiveArrayCritical(timeZone, timeZone_ptr, 0); + } +} + +static void nScriptCAddType(JNIEnv *_env, jobject _this, jint type) { RsContext con = (RsContext)(_env->GetIntField(_this, gContextId)); @@ -1052,6 +1069,7 @@ static JNINativeMethod methods[] = { {"nScriptCSetClearColor", "(FFFF)V", (void*)nScriptCSetClearColor }, {"nScriptCSetClearDepth", "(F)V", (void*)nScriptCSetClearDepth }, {"nScriptCSetClearStencil", "(I)V", (void*)nScriptCSetClearStencil }, +{"nScriptCSetTimeZone", "([B)V", (void*)nScriptCSetTimeZone }, {"nScriptCAddType", "(I)V", (void*)nScriptCAddType }, {"nScriptCSetRoot", "(Z)V", (void*)nScriptCSetRoot }, {"nScriptCSetScript", "([BII)V", (void*)nScriptCSetScript }, |