summaryrefslogtreecommitdiffstats
path: root/core/jni/android/opengl/util.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2015-04-13 19:20:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-04-13 19:20:59 +0000
commit073f36c6c1bc937a55393f7fe9a21b95e822bfda (patch)
treeb893a2628d6bf80f5c41a0941b38809a741e6657 /core/jni/android/opengl/util.cpp
parentbed238fcea7c5dc5f0ad6f14d1b585b0947a4cdc (diff)
parenta771b9861d11671c780092d35c0062eeefcf37c0 (diff)
downloadframeworks_base-073f36c6c1bc937a55393f7fe9a21b95e822bfda.zip
frameworks_base-073f36c6c1bc937a55393f7fe9a21b95e822bfda.tar.gz
frameworks_base-073f36c6c1bc937a55393f7fe9a21b95e822bfda.tar.bz2
Merge "Change how Java Bitmaps are accessed in a few places"
Diffstat (limited to 'core/jni/android/opengl/util.cpp')
-rw-r--r--core/jni/android/opengl/util.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/jni/android/opengl/util.cpp b/core/jni/android/opengl/util.cpp
index 5c2d0d0..bce2b33 100644
--- a/core/jni/android/opengl/util.cpp
+++ b/core/jni/android/opengl/util.cpp
@@ -618,23 +618,25 @@ static int getType(SkColorType colorType)
static jint util_getInternalFormat(JNIEnv *env, jclass clazz,
jobject jbitmap)
{
- SkBitmap const * nativeBitmap = GraphicsJNI::getSkBitmap(env, jbitmap);
- return getInternalFormat(nativeBitmap->colorType());
+ SkBitmap nativeBitmap;
+ GraphicsJNI::getSkBitmap(env, jbitmap, &nativeBitmap);
+ return getInternalFormat(nativeBitmap.colorType());
}
static jint util_getType(JNIEnv *env, jclass clazz,
jobject jbitmap)
{
- SkBitmap const * nativeBitmap = GraphicsJNI::getSkBitmap(env, jbitmap);
- return getType(nativeBitmap->colorType());
+ SkBitmap nativeBitmap;
+ GraphicsJNI::getSkBitmap(env, jbitmap, &nativeBitmap);
+ return getType(nativeBitmap.colorType());
}
static jint util_texImage2D(JNIEnv *env, jclass clazz,
jint target, jint level, jint internalformat,
jobject jbitmap, jint type, jint border)
{
- SkBitmap const * nativeBitmap = GraphicsJNI::getSkBitmap(env, jbitmap);
- const SkBitmap& bitmap(*nativeBitmap);
+ SkBitmap bitmap;
+ GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap);
SkColorType colorType = bitmap.colorType();
if (internalformat < 0) {
internalformat = getInternalFormat(colorType);
@@ -680,8 +682,8 @@ static jint util_texSubImage2D(JNIEnv *env, jclass clazz,
jint target, jint level, jint xoffset, jint yoffset,
jobject jbitmap, jint format, jint type)
{
- SkBitmap const * nativeBitmap = GraphicsJNI::getSkBitmap(env, jbitmap);
- const SkBitmap& bitmap(*nativeBitmap);
+ SkBitmap bitmap;
+ GraphicsJNI::getSkBitmap(env, jbitmap, &bitmap);
SkColorType colorType = bitmap.colorType();
if (format < 0) {
format = getInternalFormat(colorType);