diff options
Diffstat (limited to 'rs')
-rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index cbe87fc..ae48a5f 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -1102,9 +1102,8 @@ static jlong nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { - SkBitmap const * nativeBitmap = - GraphicsJNI::getSkBitmap(_env, jbitmap); - const SkBitmap& bitmap(*nativeBitmap); + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap); bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); @@ -1119,9 +1118,8 @@ static jlong nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { - SkBitmap const * nativeBitmap = - GraphicsJNI::getSkBitmap(_env, jbitmap); - const SkBitmap& bitmap(*nativeBitmap); + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap); bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); @@ -1136,9 +1134,8 @@ static jlong nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip, jobject jbitmap, jint usage) { - SkBitmap const * nativeBitmap = - GraphicsJNI::getSkBitmap(_env, jbitmap); - const SkBitmap& bitmap(*nativeBitmap); + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap); bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); @@ -1152,9 +1149,8 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong ty static void nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { - SkBitmap const * nativeBitmap = - GraphicsJNI::getSkBitmap(_env, jbitmap); - const SkBitmap& bitmap(*nativeBitmap); + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap); int w = bitmap.width(); int h = bitmap.height(); @@ -1169,9 +1165,8 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, j static void nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap) { - SkBitmap const * nativeBitmap = - GraphicsJNI::getSkBitmap(_env, jbitmap); - const SkBitmap& bitmap(*nativeBitmap); + SkBitmap bitmap; + GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap); bitmap.lockPixels(); void* ptr = bitmap.getPixels(); |