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

Clemens Eisserer linuxhippy at gmail.com
Thu Nov 7 00:05:06 UTC 2013


Hi Sergey,

> Well during draw of the image we should request appropriate scale image from
> the user, who possible know better how its image can be scaled.
> What can be better, than a method which "Creates a scaled version of this
> image."?

getScaledImage() returns a scaled "reference" (not a copy) of the
original image.
So when the original image is changed, the scaled instance has to change too.
When this is overriden like you suggest, this changes semantics of the API.

In case getScaledInstance() is not overridden, the user is stuck with
non-accelerated blits.
Chris has written a nice blog post about getScaledImage() and why it
should be avoided:
https://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html

Regards, Clemens



More information about the 2d-dev mailing list