summaryrefslogtreecommitdiff
path: root/rs/jni
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2017-04-17 17:05:48 -0400
committerMike Reed <reed@google.com>2017-04-18 10:22:42 -0400
commit7c0ae0f58b9f258560088b670d3a4cb3ec5d832a (patch)
treedcbf7f79e0d6ad941c77cfc0e70299295678c76a /rs/jni
parent8e3b1a63f9cd76a71ecbfc8c6a0c68b4cbecab90 (diff)
bitmaps and pixelrefs no longer need lock/unlock
Test: covered by CtsGraphicsTestCases and hwui_unit_tests Change-Id: I42a25961a2eb3755d2fd22a617aa21a24ec0994f
Diffstat (limited to 'rs/jni')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 0acbb0258944..f6d3f4835381 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -1324,12 +1324,10 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type,
SkBitmap bitmap;
GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
- bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCreateFromBitmap((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
ptr, bitmap.getSize(), usage);
- bitmap.unlockPixels();
return id;
}
@@ -1340,12 +1338,10 @@ nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con,
SkBitmap bitmap;
GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
- bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCreateTyped((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
(uint32_t)usage, (uintptr_t)ptr);
- bitmap.unlockPixels();
return id;
}
@@ -1356,12 +1352,10 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong ty
SkBitmap bitmap;
GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
- bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCubeCreateFromBitmap((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
ptr, bitmap.getSize(), usage);
- bitmap.unlockPixels();
return id;
}
@@ -1373,12 +1367,10 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, j
int w = bitmap.width();
int h = bitmap.height();
- bitmap.lockPixels();
const void* ptr = bitmap.getPixels();
rsAllocation2DData((RsContext)con, (RsAllocation)alloc, 0, 0,
0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X,
w, h, ptr, bitmap.getSize(), 0);
- bitmap.unlockPixels();
}
static void
@@ -1387,10 +1379,8 @@ nAllocationCopyToBitmap(JNIEnv *_env, jobject _this, jlong con, jlong alloc, job
SkBitmap bitmap;
GraphicsJNI::getSkBitmap(_env, jbitmap, &bitmap);
- bitmap.lockPixels();
void* ptr = bitmap.getPixels();
rsAllocationCopyToBitmap((RsContext)con, (RsAllocation)alloc, ptr, bitmap.getSize());
- bitmap.unlockPixels();
bitmap.notifyPixelsChanged();
}