diff options
author | Narayan Kamath <narayan@google.com> | 2014-01-29 12:21:21 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-01-29 12:21:21 +0000 |
commit | c74f7619e19f4d172fc0bc6220abc917024c45b0 (patch) | |
tree | 505bd03e6ad41aba18fcea0ce5a49a2152d90843 /core/jni | |
parent | 0cc4bb1ff30a7e2ef96837b1dbe79a89d5145dc2 (diff) | |
parent | cdc095ae4850d9ffd08de0d6e8828949603fcdd1 (diff) | |
download | frameworks_base-c74f7619e19f4d172fc0bc6220abc917024c45b0.zip frameworks_base-c74f7619e19f4d172fc0bc6220abc917024c45b0.tar.gz frameworks_base-c74f7619e19f4d172fc0bc6220abc917024c45b0.tar.bz2 |
am cdc095ae: am 7be33110: am d4ccffd3: Merge "AArch64: Use long for pointers in graphics/Interpolator"
* commit 'cdc095ae4850d9ffd08de0d6e8828949603fcdd1':
AArch64: Use long for pointers in graphics/Interpolator
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android/graphics/Interpolator.cpp | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/core/jni/android/graphics/Interpolator.cpp b/core/jni/android/graphics/Interpolator.cpp index aa33c3d..ca04dfe 100644 --- a/core/jni/android/graphics/Interpolator.cpp +++ b/core/jni/android/graphics/Interpolator.cpp @@ -5,23 +5,26 @@ #include "SkInterpolator.h" #include "SkTemplates.h" -static SkInterpolator* Interpolator_constructor(JNIEnv* env, jobject clazz, int valueCount, int frameCount) +static jlong Interpolator_constructor(JNIEnv* env, jobject clazz, jint valueCount, jint frameCount) { - return new SkInterpolator(valueCount, frameCount); + return reinterpret_cast<jlong>(new SkInterpolator(valueCount, frameCount)); } -static void Interpolator_destructor(JNIEnv* env, jobject clazz, SkInterpolator* interp) +static void Interpolator_destructor(JNIEnv* env, jobject clazz, jlong interpHandle) { + SkInterpolator* interp = reinterpret_cast<SkInterpolator*>(interpHandle); delete interp; } -static void Interpolator_reset(JNIEnv* env, jobject clazz, SkInterpolator* interp, int valueCount, int frameCount) +static void Interpolator_reset(JNIEnv* env, jobject clazz, jlong interpHandle, jint valueCount, jint frameCount) { + SkInterpolator* interp = reinterpret_cast<SkInterpolator*>(interpHandle); interp->reset(valueCount, frameCount); } -static void Interpolator_setKeyFrame(JNIEnv* env, jobject clazz, SkInterpolator* interp, int index, int msec, jfloatArray valueArray, jfloatArray blendArray) +static void Interpolator_setKeyFrame(JNIEnv* env, jobject clazz, jlong interpHandle, jint index, jint msec, jfloatArray valueArray, jfloatArray blendArray) { + SkInterpolator* interp = reinterpret_cast<SkInterpolator*>(interpHandle); SkScalar blendStorage[4]; SkScalar* blend = NULL; @@ -46,8 +49,9 @@ static void Interpolator_setKeyFrame(JNIEnv* env, jobject clazz, SkInterpolator* interp->setKeyFrame(index, msec, scalars, blend); } -static void Interpolator_setRepeatMirror(JNIEnv* env, jobject clazz, SkInterpolator* interp, float repeatCount, jboolean mirror) +static void Interpolator_setRepeatMirror(JNIEnv* env, jobject clazz, jlong interpHandle, jfloat repeatCount, jboolean mirror) { + SkInterpolator* interp = reinterpret_cast<SkInterpolator*>(interpHandle); if (repeatCount > 32000) repeatCount = 32000; @@ -55,8 +59,9 @@ static void Interpolator_setRepeatMirror(JNIEnv* env, jobject clazz, SkInterpola interp->setMirror(mirror != 0); } -static int Interpolator_timeToValues(JNIEnv* env, jobject clazz, SkInterpolator* interp, int msec, jfloatArray valueArray) +static jint Interpolator_timeToValues(JNIEnv* env, jobject clazz, jlong interpHandle, jint msec, jfloatArray valueArray) { + SkInterpolator* interp = reinterpret_cast<SkInterpolator*>(interpHandle); SkInterpolatorBase::Result result; float* values = valueArray ? env->GetFloatArrayElements(valueArray, NULL) : NULL; @@ -70,7 +75,7 @@ static int Interpolator_timeToValues(JNIEnv* env, jobject clazz, SkInterpolator* env->ReleaseFloatArrayElements(valueArray, values, 0); } - return result; + return static_cast<jint>(result); } // ---------------------------------------------------------------------------- @@ -79,12 +84,12 @@ static int Interpolator_timeToValues(JNIEnv* env, jobject clazz, SkInterpolator* * JNI registration. */ static JNINativeMethod gInterpolatorMethods[] = { - { "nativeConstructor", "(II)I", (void*)Interpolator_constructor }, - { "nativeDestructor", "(I)V", (void*)Interpolator_destructor }, - { "nativeReset", "(III)V", (void*)Interpolator_reset }, - { "nativeSetKeyFrame", "(III[F[F)V", (void*)Interpolator_setKeyFrame }, - { "nativeSetRepeatMirror", "(IFZ)V", (void*)Interpolator_setRepeatMirror }, - { "nativeTimeToValues", "(II[F)I", (void*)Interpolator_timeToValues } + { "nativeConstructor", "(II)J", (void*)Interpolator_constructor }, + { "nativeDestructor", "(J)V", (void*)Interpolator_destructor }, + { "nativeReset", "(JII)V", (void*)Interpolator_reset }, + { "nativeSetKeyFrame", "(JII[F[F)V", (void*)Interpolator_setKeyFrame }, + { "nativeSetRepeatMirror", "(JFZ)V", (void*)Interpolator_setRepeatMirror }, + { "nativeTimeToValues", "(JI[F)I", (void*)Interpolator_timeToValues } }; int register_android_graphics_Interpolator(JNIEnv* env) |