Lines Matching refs:env

74 static void throwException(JNIEnv* env, const char* className, const char* message) {
75 jclass exceptionClass = env->FindClass(className);
76 env->ThrowNew(exceptionClass, message);
79 static void throwIllegalStateException(JNIEnv* env, char *message) {
81 throwException(env, className, message);
84 static void throwIllegalArgumentException(JNIEnv* env, char* message) {
86 throwException(env, className, message);
89 static void readBitmapPixels(JNIEnv* env, jclass /* clazz */, jobject jbitmap, jint fd) {
94 throwIllegalStateException(env, (char*) "Cannot read bitmap info");
100 int result = AndroidBitmap_getInfo(env, jbitmap, &targetInfo);
102 throwIllegalStateException(env, (char*) "Cannot get bitmap info");
110 throwIllegalArgumentException(env, (char*) "Cannot reuse bitmap");
116 result = AndroidBitmap_lockPixels(env, jbitmap, &pixels);
118 throwIllegalStateException(env, (char*) "Cannot lock bitmap pixels");
126 throwIllegalStateException(env, (char*) "Cannot read bitmap pixels");
131 result = AndroidBitmap_unlockPixels(env, jbitmap);
133 throwIllegalStateException(env, (char*) "Cannot unlock bitmap pixels");
137 static void writeBitmapPixels(JNIEnv* env, jclass /* clazz */, jobject jbitmap, jint fd) {
140 int result = AndroidBitmap_getInfo(env, jbitmap, &info);
142 throwIllegalStateException(env, (char*) "Cannot get bitmap info");
149 throwIllegalStateException(env, (char*) "Cannot write bitmap info");
155 result = AndroidBitmap_lockPixels(env, jbitmap, &pixels);
157 throwIllegalStateException(env, (char*) "Cannot lock bitmap pixels");
165 throwIllegalStateException(env, (char*) "Cannot write bitmap pixels");
170 result = AndroidBitmap_unlockPixels(env, jbitmap);
172 throwIllegalStateException(env, (char*) "Cannot unlock bitmap pixels");
181 int register_com_android_printspooler_util_BitmapSerializeUtils(JNIEnv* env) {
182 return jniRegisterNativeMethods(env, "com/android/printspooler/util/BitmapSerializeUtils",
189 JNIEnv *env = NULL;
190 if (jvm->GetEnv((void**) &env, JNI_VERSION_1_6)) {
194 if (android::register_com_android_printspooler_util_BitmapSerializeUtils(env) == -1) {