diff options
| author | John Reck <jreck@google.com> | 2015-04-13 19:20:58 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-13 19:20:59 +0000 |
| commit | 073f36c6c1bc937a55393f7fe9a21b95e822bfda (patch) | |
| tree | b893a2628d6bf80f5c41a0941b38809a741e6657 /core/jni/android/opengl/util.cpp | |
| parent | bed238fcea7c5dc5f0ad6f14d1b585b0947a4cdc (diff) | |
| parent | a771b9861d11671c780092d35c0062eeefcf37c0 (diff) | |
| download | frameworks_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.cpp | 18 |
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); |
