Loading core/jni/android/graphics/Bitmap.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -851,10 +851,9 @@ static jlong Bitmap_getNativeFinalizer(JNIEnv*, jobject) { return static_cast<jlong>(reinterpret_cast<uintptr_t>(&Bitmap_destruct)); } static jboolean Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) { static void Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) { LocalScopedBitmap bitmap(bitmapHandle); bitmap->freePixels(); return JNI_TRUE; } static void Bitmap_reconfigure(JNIEnv* env, jobject clazz, jlong bitmapHandle, Loading Loading @@ -1600,7 +1599,7 @@ static const JNINativeMethod gBitmapMethods[] = { { "nativeCopyAshmemConfig", "(JI)Landroid/graphics/Bitmap;", (void*)Bitmap_copyAshmemConfig }, { "nativeGetNativeFinalizer", "()J", (void*)Bitmap_getNativeFinalizer }, { "nativeRecycle", "(J)Z", (void*)Bitmap_recycle }, { "nativeRecycle", "(J)V", (void*)Bitmap_recycle }, { "nativeReconfigure", "(JIIIZ)V", (void*)Bitmap_reconfigure }, { "nativeCompress", "(JIILjava/io/OutputStream;[B)Z", (void*)Bitmap_compress }, Loading graphics/java/android/graphics/Bitmap.java +4 −9 Original line number Diff line number Diff line Loading @@ -344,14 +344,9 @@ public final class Bitmap implements Parcelable { * there are no more references to this bitmap. */ public void recycle() { if (!mRecycled && mNativePtr != 0) { if (nativeRecycle(mNativePtr)) { // return value indicates whether native pixel object was actually recycled. // false indicates that it is still in use at the native level and these // objects should not be collected now. They will be collected later when the // Bitmap itself is collected. if (!mRecycled) { nativeRecycle(mNativePtr); mNinePatchChunk = null; } mRecycled = true; } } Loading Loading @@ -2052,7 +2047,7 @@ public final class Bitmap implements Parcelable { private static native Bitmap nativeCopyAshmem(long nativeSrcBitmap); private static native Bitmap nativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig); private static native long nativeGetNativeFinalizer(); private static native boolean nativeRecycle(long nativeBitmap); private static native void nativeRecycle(long nativeBitmap); private static native void nativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied); Loading Loading
core/jni/android/graphics/Bitmap.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -851,10 +851,9 @@ static jlong Bitmap_getNativeFinalizer(JNIEnv*, jobject) { return static_cast<jlong>(reinterpret_cast<uintptr_t>(&Bitmap_destruct)); } static jboolean Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) { static void Bitmap_recycle(JNIEnv* env, jobject, jlong bitmapHandle) { LocalScopedBitmap bitmap(bitmapHandle); bitmap->freePixels(); return JNI_TRUE; } static void Bitmap_reconfigure(JNIEnv* env, jobject clazz, jlong bitmapHandle, Loading Loading @@ -1600,7 +1599,7 @@ static const JNINativeMethod gBitmapMethods[] = { { "nativeCopyAshmemConfig", "(JI)Landroid/graphics/Bitmap;", (void*)Bitmap_copyAshmemConfig }, { "nativeGetNativeFinalizer", "()J", (void*)Bitmap_getNativeFinalizer }, { "nativeRecycle", "(J)Z", (void*)Bitmap_recycle }, { "nativeRecycle", "(J)V", (void*)Bitmap_recycle }, { "nativeReconfigure", "(JIIIZ)V", (void*)Bitmap_reconfigure }, { "nativeCompress", "(JIILjava/io/OutputStream;[B)Z", (void*)Bitmap_compress }, Loading
graphics/java/android/graphics/Bitmap.java +4 −9 Original line number Diff line number Diff line Loading @@ -344,14 +344,9 @@ public final class Bitmap implements Parcelable { * there are no more references to this bitmap. */ public void recycle() { if (!mRecycled && mNativePtr != 0) { if (nativeRecycle(mNativePtr)) { // return value indicates whether native pixel object was actually recycled. // false indicates that it is still in use at the native level and these // objects should not be collected now. They will be collected later when the // Bitmap itself is collected. if (!mRecycled) { nativeRecycle(mNativePtr); mNinePatchChunk = null; } mRecycled = true; } } Loading Loading @@ -2052,7 +2047,7 @@ public final class Bitmap implements Parcelable { private static native Bitmap nativeCopyAshmem(long nativeSrcBitmap); private static native Bitmap nativeCopyAshmemConfig(long nativeSrcBitmap, int nativeConfig); private static native long nativeGetNativeFinalizer(); private static native boolean nativeRecycle(long nativeBitmap); private static native void nativeRecycle(long nativeBitmap); private static native void nativeReconfigure(long nativeBitmap, int width, int height, int config, boolean isPremultiplied); Loading