<AWT Dev> [OpenJDK 2D-Dev] [8] Review request for 8011059 [macosx] Make JDK demos look perfect on retina displays

Jim Graham james.graham at oracle.com
Wed Nov 6 18:01:20 PST 2013



On 11/6/13 5:20 PM, Sergey Bylokhov wrote:
>> In other words:
>>
>> package sun.awt.image;
>>
>> public interface MultiResImage {
>>     public Image getResolutionVariant(float resolution);
>> }
>>
>> public class MacImage extends Image implements MultiResImage {
>>     public Image getResolutionVariant(float resolution) {
>>         if (resolution >= 2f && ImageAt2x != null) {
>>             return ImageAt2x;
>>         }
>>         return this;
>>     }
>> }
>>
>> SG2D.drawImage() {
>>     if (img instanceof MultiResImage && dest.pixelscale != 1) {
>>         img = ((MultiResImage)
>> img).getResolutionVariant(dest.pixelscale);
>>     }
>> }
> In this example there is a problem. For example we have 2
> BufferedImages/ToolkiImagest A and B; Both wants be scaled perfectly.
>   - Image A draws to the image B
>   - Image B draws to the window.
>
> When window is moving from the screen x1 to the screen x2 and back. How
> to handle this situation?
> In this case getResolutionVariant() can return
>
>
> Related  discussion:
> http://mail.openjdk.java.net/pipermail/macosx-port-dev/2013-April/005580.html
> http://mail.openjdk.java.net/pipermail/macosx-port-dev/2013-April/005581.html

How does calling getScaledInstance() deal with that?  Note the above was 
simply to demonstrate the visibility of the interface, not to be a 
complete implementation...

			...jim


More information about the awt-dev mailing list