diff options
author | Mike Reed <reed@google.com> | 2009-10-28 15:09:45 -0400 |
---|---|---|
committer | Mike Reed <reed@google.com> | 2009-10-28 15:18:41 -0400 |
commit | c04851fd0af87f44a7d7351e0c17442fa1d3fc28 (patch) | |
tree | 0e719838846f5a5ccc12c8eb38a2322db39ce373 /core/jni/android/graphics/Graphics.cpp | |
parent | 9fa7048ca3a7b5184ce761bbf908c512d524b9e2 (diff) | |
download | frameworks_base-c04851fd0af87f44a7d7351e0c17442fa1d3fc28.zip frameworks_base-c04851fd0af87f44a7d7351e0c17442fa1d3fc28.tar.gz frameworks_base-c04851fd0af87f44a7d7351e0c17442fa1d3fc28.tar.bz2 |
add boundary patch
Diffstat (limited to 'core/jni/android/graphics/Graphics.cpp')
-rw-r--r-- | core/jni/android/graphics/Graphics.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/jni/android/graphics/Graphics.cpp b/core/jni/android/graphics/Graphics.cpp index 2e0caed..01aad93 100644 --- a/core/jni/android/graphics/Graphics.cpp +++ b/core/jni/android/graphics/Graphics.cpp @@ -56,7 +56,7 @@ bool GraphicsJNI::hasException(JNIEnv *env) { /////////////////////////////////////////////////////////////////////////////// AutoJavaFloatArray::AutoJavaFloatArray(JNIEnv* env, jfloatArray array, - int minLength) + int minLength, JNIAccess access) : fEnv(env), fArray(array), fPtr(NULL), fLen(0) { SkASSERT(env); if (array) { @@ -66,11 +66,12 @@ AutoJavaFloatArray::AutoJavaFloatArray(JNIEnv* env, jfloatArray array, } fPtr = env->GetFloatArrayElements(array, NULL); } + fReleaseMode = (access == kRO_JNIAccess) ? JNI_ABORT : 0; } AutoJavaFloatArray::~AutoJavaFloatArray() { if (fPtr) { - fEnv->ReleaseFloatArrayElements(fArray, fPtr, 0); + fEnv->ReleaseFloatArrayElements(fArray, fPtr, fReleaseMode); } } @@ -94,7 +95,7 @@ AutoJavaIntArray::~AutoJavaIntArray() { } AutoJavaShortArray::AutoJavaShortArray(JNIEnv* env, jshortArray array, - int minLength) + int minLength, JNIAccess access) : fEnv(env), fArray(array), fPtr(NULL), fLen(0) { SkASSERT(env); if (array) { @@ -104,11 +105,12 @@ AutoJavaShortArray::AutoJavaShortArray(JNIEnv* env, jshortArray array, } fPtr = env->GetShortArrayElements(array, NULL); } + fReleaseMode = (access == kRO_JNIAccess) ? JNI_ABORT : 0; } AutoJavaShortArray::~AutoJavaShortArray() { if (fPtr) { - fEnv->ReleaseShortArrayElements(fArray, fPtr, 0); + fEnv->ReleaseShortArrayElements(fArray, fPtr, fReleaseMode); } } |