<AWT Dev> [9] Review request for JDK-8145174 HiDPI splash screen support on Linux

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Wed Feb 17 21:24:48 UTC 2016

On 12/02/16 16:21, Rajeev Chamyal wrote:
> Hello All,
> Could you please review the following fix.
> Bug : https://bugs.openjdk.java.net/browse/JDK-8145174
> Webrev : http://cr.openjdk.java.net/~rchamyal/8145174/webrev.00/ 
> <http://cr.openjdk.java.net/%7Erchamyal/8145174/webrev.00/>
> This is an enhancement to support HiDPI splash screen on Linux.
> As a part of this enhancement implementation to 
> splashscreen_sys.c::SplashGetScaledImageName method has been provided 
> based on the GDK_SCALE environment variable set on unix/linux system.
> The new implementation checks for GDK_SCALE set on system and returns 
> the scaled image name, if GDK_SCALE=2 otherwise NULL.
> The naming convention followed for scaled image is as follows:
> Unscaled image name : image.ext
> Scaled image name : image.java-scale2x.ext

   - It may be useful to have the same name convention for 
high-resolution splash screen on all platforms.
     It allows to use only one  image.java-scale2x.ext file instead to 
have image at 2x.ext on Mac OS X and name.scale-200.ext on Windows.
     Could you create an enhancement on it and send it to the review?
> The automated jtreg test for this is currently failing due to issues 
> in robot.getPixelColor it is returning wrong pixel color for GDK_SCALE=2.
> Also fixed issues in following files.
> 1)splashscreen_impl.c::SplashInit() was resetting the scaleFactor to 1.
   - SplashSetScaleFactor should not be called from the 
SplashGetScaledImageName method because SplashInit has not been called yet.
   - The problem with setting the scale factor in SplashInit is that it 
is not clear is the high-resolution splash screen image provided or not. 
If the the high-resolution splash screen is not provided the scale 
factor should be set to 1.
   - The java.c uses the following sequence for the splash screen 
    scaled_splash_name = DoSplashGetScaledImageName(
                         jar_name, file_name, &scale_factor);
To make the SplashSetScaleFactor method work it should also be added to 
the make/mapfiles/libsplashscreen/mapfile-vers file.

  - There are two codes which detect the scale factor. One is in the 
splash screen (getNativeScaleFactor()  method)
   and another in the AWT 
(src/java.desktop/unix/native/libawt_xawt/awt/awt_GraphicsEnv.c file).
   Is it possible to move it one code that it will be used both from 
splash screen and from AWT?

> 2)SplashScreen.java:: getBounds fixed the typo.
> Regards,
> Rajeev Chamyal

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20160218/b5afc22d/attachment.html>

More information about the awt-dev mailing list