JDK-8102112 : HiDPI support does not load HiDPI assets
  • Type: Enhancement
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-01-26
  • Updated: 2015-06-16
  • Resolved: 2013-02-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Fixed
Related Reports
Blocks :  
Description
The various platforms (MacOS, Windows 8) have conventions for storing high resolution images alongside regular resolution versions (appending @2x to the filename on Mac, for instance).  The initial support for HiDPI in RT-24009 did not include support for loading these higher resolution assets.
Comments
Fixed in the 8.0 graphics scrum with the following changesets: Changeset for rt: changeset: 2488:db6fc38a2116 date: Tue Feb 05 09:28:10 2013 -0800 summary: Fix RT-27964 - Load HiDPI images when available on HiDPI displays Changeset for rt-closed: changeset: 17985:b2c4ddedfbce date: Tue Feb 05 09:27:41 2013 -0800 summary: Fix RT-27964 - Load HiDPI images when available on HiDPI displays Tested with the test cases attached to this issue on a Retina MBP.
05-02-2013

Attaching a new test case PixelReadDPI.java that verifies that pixel reading still occurs (at half-dpi) for HiDPI assets. The test case needs to be run on a High Resolution output device on a Mac (such as a Retina MBP) to verify the bug.
05-02-2013

Attaching LargeImageDPITest.java that repeats those same tests with an image that is larger than the typical maximum texture size to test the large-image viewport support in ImageView for @2x images. Note that it only does the first row of tests (ImageView with @2x image available and without, both with and without a viewport) because ImageInput and Canvas do not yet support images larger than a texture size. Note that you should run the LargeImageDPITest with a very large heap size (at least 3GB) due to the large size of the images involved...
01-02-2013

The attached test ImageDPITest.java creates its own low and high DPI images with the appropriate names and then loads and uses those images in 3 different ways: - In a standard ImageView - And in an ImageView with a viewport - In an ImageInput effect input - In a Canvas drawImage method - And in a Canvas drawImage sub-image method The tests are executed twice each - once on a pair of images with the naming convention for low and hi dpi images (image1.png and image1@2x.png) and again on an isolated image available only in a low dpi format (image2.png). The low and hi dpi images say "Low" or "High" in them and the single dpi image just says "Only" so that the user can track which images were loaded in response to the requested file names. In each case the "dual dpi" image test is the test in the 1st column and the "single dpi" image test is the test in the 2nd column. The 3rd and 4th columns represent the tests with a viewport or subimage specified. The first row are the ImageView tests, the second row are the Effect tests and the 3rd row is the Canvas tests. The test must be run on a Mac with Retina screen to trigger the hi dpi images until other high resolution platforms are available and supported.
01-02-2013