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

Jim Graham james.graham at oracle.com
Thu Nov 7 00:12:42 UTC 2013


Thanks Clemens, I completely forgot about how this all interacts with 
old 1.1-style "generated images", but that is a further complication in 
that those images that never sent an IMAGE_COMPLETE notification were 
dynamic in a very unhealthy way and creating a scaled instance was just 
one of those cases where everything could bog down.

We should be looking to obsolete and delete getScaledInstance(), not 
giving it a new lease on life with new capabilities...

			...jim

On 11/6/13 4:05 PM, Clemens Eisserer wrote:
> 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