am 8ceba810: Merge change 6871 into donut

Merge commit '8ceba810d5a5831544790e18ed05eeed7e2fa994'

* commit '8ceba810d5a5831544790e18ed05eeed7e2fa994':
  Use SetByteArrayRegion to minimize copy overhead and JNI calls.
This commit is contained in:
Android (Google) Code Review
2009-07-13 09:06:12 -07:00
committed by The Android Open Source Project

View File

@@ -143,10 +143,7 @@ void JNICameraContext::copyAndPost(JNIEnv* env, const sp<IMemory>& dataPtr, int
LOGE("Couldn't allocate byte array for JPEG data");
env->ExceptionClear();
} else {
jbyte *bytes = static_cast<jbyte*>(env->GetPrimitiveArrayCritical(obj, NULL));
memcpy(bytes, data, size);
env->ReleasePrimitiveArrayCritical(obj, bytes, 0);
env->SetByteArrayRegion(obj, 0, size, data);
}
} else {
LOGE("image heap is NULL");