United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-8011059 : [macosx] Support automatic @2x images loading on Mac OS X

Details
Type:
Task
Submit Date:
2013-03-29
Status:
Closed
Updated Date:
2014-07-29
Project Name:
JDK
Resolved Date:
2014-01-30
Component:
client-libs
OS:
os_x
Sub-Component:
demo
CPU:
generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
7u40,8
Fixed Versions:
8u20 (b01)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:
Relates:

Sub Tasks

Description
This issue is part of the general issue  JDK-7124410 [macosx] Lion HiDPI support 

A user provides high resolution images with @2x modifier.
The Toolkit.getImage(String filename) and Toolkit.getImage(URL url) methods should automatically load the high resolution image and show an image with best fit resolution on HiDPI display (Retina) on Mac OS X.

For example, there are files on disk:
- /dir/image.ext
- /dir/image@2x.ext

Image image = Toolkit.getDefaultToolkit().getImage("/dir/image.ext") //both images (image.ext and image@2x.ext) should be automatically loaded
graphics2d.drawImage(image,..) // The image with necessary resolution should be drawn according to the display transform and scale  
                                    

Comments
fix is on review
                                     
2013-10-23
that was fixed in 7u40, so it becomes P2 from jdk8 pov
                                     
2013-12-05
- webrev link:  http://cr.openjdk.java.net/~alexsch/8011059/webrev.14/
- review link: http://mail.openjdk.java.net/pipermail/awt-dev/2013-December/006540.html
- JPRT build link: http://bus2001067.us.oracle.com/archives/2013/12/2013-12-05-114309.alex.jdk8-awt/bundles/
- issue impact: Users images will look ugly on HiDPI displays like Retina on Mac OS X
- fix rational: Allow to use images with high resolution on HiDPI Displays (Retina on Mac OS X)
 -risks: Low 
 -suggested testing: run automated tests  jdk/test/java/awt/image/MultiResolutionImageTest.java

                                     
2013-12-05
SQE: OK to push in jdk8
                                     
2013-12-05
The synopsis of this bug is misleading.  It's really about an API change (adding additional constants to RenderingHints), not directly about making the demos look perfect.
                                     
2013-12-05
NMI: need an assessment of the risk, fix the synopsis to reflect that this is an API change, explain the nature of the code change.
                                     
2013-12-05
It was decided to not expose new public API for this bug.
I have withdrawn the CCC request 8011059 http://ccc.us.oracle.com/8011059 and created the separated issue  JDK-8029339 Custom MultiResolution image support on HiDPI displays
So no public class fields or methods (RenderingHints) are added.
                                     
2013-12-06
The fix consists of 2 parts
- high resolution images with @2x modifier are automatically loaded by LWCToolkit on Mac OS X
-  SunGraphics2D.drawImage(Image...) method draws an image with necessary resolution according to the current display scale and transform

If no image with  @2x modifier is provided the standard logic to draw the base image is used.
If image with @2x modifier is provided then an algorithm calculates actual image width and height to be drawn on screen according to the display scale and transform, gets an image with necessary resolution and draw it in the standard way. 
If an image  with  @2x modifier contains an error the base image is drawn in the standard way.

There should be low risk of this fix because the base algorithms that loads and draws images only takes in account does the ToolkitImage contains image with high resolution or not.
                                     
2013-12-06
If this fix can be completed without a new API then it is not critical for integration now.  Please defer to 8u20.

- Support for Retina is important but not a release driver
- If this could only be done via new API then there might be a case for integrating it now as we otherwise could not add new APIs until JDK 9
- Since this can be done without new APIs it is not a justifiable risk at this time
                                     
2013-12-06
8-defer-request:
High resolution images support is dropped for HiDPI displays in JDK 8.
                                     
2013-12-06
Release team: Approved for deferral.
                                     
2013-12-06
URL:   http://hg.openjdk.java.net/jdk8u/jdk8u-dev/jdk/rev/547148daf7af
User:  alexsch
Date:  2014-01-30 09:41:31 +0000

                                     
2014-01-30
URL:   http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/547148daf7af
User:  lana
Date:  2014-02-10 18:56:57 +0000

                                     
2014-02-10
No way to verify.
                                     
2014-03-07



Hardware and Software, Engineered to Work Together