Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3ea6636 authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 8ceba810: Merge change 6871 into donut

Merge commit '8ceba810'

* commit '8ceba810':
  Use SetByteArrayRegion to minimize copy overhead and JNI calls.
parents 3b76d386 8ceba810
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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");