Update awt_GraphicsEnv.c

This commit is contained in:
Tran Khanh Duy 2020-10-06 12:43:11 +07:00 committed by GitHub
parent 120d727e28
commit a7848f938e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,8 +165,9 @@ JNIEXPORT jint JNICALL Java_sun_awt_X11GraphicsConfig_getNumColors(JNIEnv *env,
JNIEXPORT void JNICALL Java_sun_awt_X11GraphicsConfig_init(JNIEnv *env, jobject this, jint visualNum, jint screen) {
// Android: 16bits pixel
jclass cls = (*env)->GetObjectClass(env, this);
jfieldID bitsPerPixel = (*env)->GetFieldID(env, cls, "bitsPerPixel", "I");
(*env)->SetIntField(env, (*env)->GetObjectClass(env, this), bitsPerPixel,
(*env)->SetIntField(env, cls, bitsPerPixel,
(jint) 16 /* tempImage->bits_per_pixel */);
}