< prev index next >

src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c

Print this page




2164                 if (output_info->name) {
2165                     name = strdup(output_info->name);
2166                 }
2167                 awt_XRRFreeOutputInfo(output_info);
2168             }
2169         }
2170         awt_XRRFreeScreenResources(res);
2171     }
2172     AWT_UNLOCK();
2173     return name;
2174 }
2175 
2176 /*
2177  * Class:     sun_awt_X11GraphicsDevice
2178  * Method:    getNativeScaleFactor
2179  * Signature: (I)D
2180  */
2181 JNIEXPORT jdouble JNICALL
2182 Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor
2183     (JNIEnv *env, jobject this, jint screen) {
2184     char *name = get_output_screen_name(env, screen);

2185     double scale = getNativeScaleFactor(name);
2186     if (name) {
2187         free(name);
2188     }
2189     return scale;
2190 }


2164                 if (output_info->name) {
2165                     name = strdup(output_info->name);
2166                 }
2167                 awt_XRRFreeOutputInfo(output_info);
2168             }
2169         }
2170         awt_XRRFreeScreenResources(res);
2171     }
2172     AWT_UNLOCK();
2173     return name;
2174 }
2175 
2176 /*
2177  * Class:     sun_awt_X11GraphicsDevice
2178  * Method:    getNativeScaleFactor
2179  * Signature: (I)D
2180  */
2181 JNIEXPORT jdouble JNICALL
2182 Java_sun_awt_X11GraphicsDevice_getNativeScaleFactor
2183     (JNIEnv *env, jobject this, jint screen) {
2184     // in case of Xinerama individual screen scales are not supported
2185     char *name = get_output_screen_name(env, usingXinerama ? 0 : screen);
2186     double scale = getNativeScaleFactor(name);
2187     if (name) {
2188         free(name);
2189     }
2190     return scale;
2191 }
< prev index next >