diff options
author | John Reck <jreck@google.com> | 2015-04-15 13:24:47 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2015-05-01 14:30:21 -0700 |
commit | c6e2e8ff474ae44bab5b9eb665851118abd27b68 (patch) | |
tree | 1c193512201d8fd4ca033f3979849dd1b9b2a861 /core/jni | |
parent | 78760b4ae47f5d59a541cbcbf1fca623bae4508a (diff) | |
download | frameworks_base-c6e2e8ff474ae44bab5b9eb665851118abd27b68.zip frameworks_base-c6e2e8ff474ae44bab5b9eb665851118abd27b68.tar.gz frameworks_base-c6e2e8ff474ae44bab5b9eb665851118abd27b68.tar.bz2 |
Move AssetAtlas off of SkBitmap*
Switched to SkPixelRef*
Change-Id: I4a1d9dc6c55c1ebcce6b0b8c585e69559e523898
Diffstat (limited to 'core/jni')
-rwxr-xr-x | core/jni/android/graphics/Bitmap.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/jni/android/graphics/Bitmap.cpp b/core/jni/android/graphics/Bitmap.cpp index 7a934bd..5c95f8a 100755 --- a/core/jni/android/graphics/Bitmap.cpp +++ b/core/jni/android/graphics/Bitmap.cpp @@ -857,6 +857,13 @@ static void Bitmap_prepareToDraw(JNIEnv* env, jobject, jlong bitmapHandle) { bitmap->unlockPixels(); } +static jlong Bitmap_refPixelRef(JNIEnv* env, jobject, jlong bitmapHandle) { + SkBitmap* bitmap = reinterpret_cast<SkBitmap*>(bitmapHandle); + SkPixelRef* pixelRef = bitmap ? bitmap->pixelRef() : nullptr; + SkSafeRef(pixelRef); + return reinterpret_cast<jlong>(pixelRef); +} + /////////////////////////////////////////////////////////////////////////////// static JNINativeMethod gBitmapMethods[] = { @@ -896,6 +903,7 @@ static JNINativeMethod gBitmapMethods[] = { (void*)Bitmap_copyPixelsFromBuffer }, { "nativeSameAs", "(JJ)Z", (void*)Bitmap_sameAs }, { "nativePrepareToDraw", "(J)V", (void*)Bitmap_prepareToDraw }, + { "nativeRefPixelRef", "(J)J", (void*)Bitmap_refPixelRef }, }; int register_android_graphics_Bitmap(JNIEnv* env) |