summaryrefslogtreecommitdiffstats
path: root/rs/jni
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-04-20 22:07:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-20 22:07:45 +0000
commit8222a7ec81552276de1814541201c424b392d90b (patch)
treee6d3ab0569338f3ade22f973019e6d7c7d45a13b /rs/jni
parent2eec3d14249640988ad6f89c49e6ea155f3ec744 (diff)
parentedc22fba5921f5c2d3502727e707f959b8c3a460 (diff)
downloadframeworks_base-8222a7ec81552276de1814541201c424b392d90b.zip
frameworks_base-8222a7ec81552276de1814541201c424b392d90b.tar.gz
frameworks_base-8222a7ec81552276de1814541201c424b392d90b.tar.bz2
Merge "Revert "Change how Java Bitmaps are accessed in a few places""
Diffstat (limited to 'rs/jni')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index ae48a5f..cbe87fc 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -1102,8 +1102,9 @@ static jlong
nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip,
jobject jbitmap, jint usage)
{
- SkBitmap bitmap;
- GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
+ SkBitmap const * nativeBitmap =
+ GraphicsJNI::getSkBitmap(_env, jbitmap);
+ const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
@@ -1118,8 +1119,9 @@ static jlong
nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con, jlong type,
jint mip, jobject jbitmap, jint usage)
{
- SkBitmap bitmap;
- GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
+ SkBitmap const * nativeBitmap =
+ GraphicsJNI::getSkBitmap(_env, jbitmap);
+ const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
@@ -1134,8 +1136,9 @@ static jlong
nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type, jint mip,
jobject jbitmap, jint usage)
{
- SkBitmap bitmap;
- GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
+ SkBitmap const * nativeBitmap =
+ GraphicsJNI::getSkBitmap(_env, jbitmap);
+ const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
@@ -1149,8 +1152,9 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong ty
static void
nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap)
{
- SkBitmap bitmap;
- GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
+ SkBitmap const * nativeBitmap =
+ GraphicsJNI::getSkBitmap(_env, jbitmap);
+ const SkBitmap& bitmap(*nativeBitmap);
int w = bitmap.width();
int h = bitmap.height();
@@ -1165,8 +1169,9 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, j
static void
nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, jobject jbitmap)
{
- SkBitmap bitmap;
- GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
+ SkBitmap const * nativeBitmap =
+ GraphicsJNI::getSkBitmap(_env, jbitmap);
+ const SkBitmap& bitmap(*nativeBitmap);
bitmap.lockPixels();
void* ptr = bitmap.getPixels();