src/share/native/sun/awt/splashscreen/java_awt_SplashScreen.c

Print this page




 203  * Method:    _setImageData
 204  * Signature: (J[B)Z
 205  */
 206 JNIEXPORT jboolean JNICALL Java_java_awt_SplashScreen__1setImageData
 207   (JNIEnv * env, jclass thisClass, jlong jsplash, jbyteArray data)
 208 {
 209     Splash *splash = (Splash *) jlong_to_ptr(jsplash);
 210     int size, rc;
 211     jbyte* pBytes;
 212 
 213     if (!splash) {
 214         return JNI_FALSE;
 215     }
 216     pBytes = (*env)->GetByteArrayElements(env, data, NULL);
 217     CHECK_NULL_RETURN(pBytes, JNI_FALSE);
 218     size = (*env)->GetArrayLength(env, data);
 219     rc = SplashLoadMemory(pBytes, size);
 220     (*env)->ReleaseByteArrayElements(env, data, pBytes, JNI_ABORT);
 221     return rc ? JNI_TRUE : JNI_FALSE;
 222 }

















 203  * Method:    _setImageData
 204  * Signature: (J[B)Z
 205  */
 206 JNIEXPORT jboolean JNICALL Java_java_awt_SplashScreen__1setImageData
 207   (JNIEnv * env, jclass thisClass, jlong jsplash, jbyteArray data)
 208 {
 209     Splash *splash = (Splash *) jlong_to_ptr(jsplash);
 210     int size, rc;
 211     jbyte* pBytes;
 212 
 213     if (!splash) {
 214         return JNI_FALSE;
 215     }
 216     pBytes = (*env)->GetByteArrayElements(env, data, NULL);
 217     CHECK_NULL_RETURN(pBytes, JNI_FALSE);
 218     size = (*env)->GetArrayLength(env, data);
 219     rc = SplashLoadMemory(pBytes, size);
 220     (*env)->ReleaseByteArrayElements(env, data, pBytes, JNI_ABORT);
 221     return rc ? JNI_TRUE : JNI_FALSE;
 222 }
 223 
 224 /*
 225  * Class:     java_awt_SplashScreen
 226  * Method:    _getScaleFactor
 227  * Signature: (J)F
 228  */
 229 JNIEXPORT jfloat JNICALL Java_java_awt_SplashScreen__1getScaleFactor
 230 (JNIEnv *env, jclass thisClass, jlong jsplash)
 231 {
 232     Splash *splash = (Splash *) jlong_to_ptr(jsplash);
 233     if (!splash) {
 234         return 1;
 235     }
 236     return splash->scaleFactor;
 237 }