OSDN Git Service

Merge "frameworks/base: use proper nativehelper headers" am: 826eafd958 am: 5c091dc944
[android-x86/frameworks-base.git] / core / jni / android / opengl / util.cpp
index 41d9111..79cc1e6 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include "jni.h"
-#include "JNIHelp.h"
+#include <nativehelper/JNIHelp.h>
 #include "GraphicsJNI.h"
 
 #include <math.h>
@@ -716,7 +716,6 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz,
     int err = checkFormat(colorType, internalformat, type);
     if (err)
         return err;
-    bitmap.lockPixels();
     const int w = bitmap.width();
     const int h = bitmap.height();
     const void* p = bitmap.getPixels();
@@ -743,7 +742,6 @@ static jint util_texImage2D(JNIEnv *env, jclass clazz,
         glTexImage2D(target, level, internalformat, w, h, border, internalformat, type, p);
     }
 error:
-    bitmap.unlockPixels();
     return err;
 }
 
@@ -762,12 +760,10 @@ static jint util_texSubImage2D(JNIEnv *env, jclass clazz,
     int err = checkFormat(colorType, format, type);
     if (err)
         return err;
-    bitmap.lockPixels();
     const int w = bitmap.width();
     const int h = bitmap.height();
     const void* p = bitmap.getPixels();
     glTexSubImage2D(target, level, xoffset, yoffset, w, h, format, type, p);
-    bitmap.unlockPixels();
     return 0;
 }