diff options
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); |