[OpenJDK 2D-Dev] <AWT Dev> [9] Review Request: JDK-8029455 JLightweightFrame: support scaled painting

Anton V. Tarasov anton.tarasov at oracle.com
Fri Feb 14 07:12:17 UTC 2014


On 14.02.2014 2:52, Jim Graham wrote:
>
>
> On 2/13/14 5:03 AM, Anton V. Tarasov wrote:
>> Hi Jim,
>>
>> Please, look at the update:
>>
>> http://cr.openjdk.java.net/~ant/JDK-8029455/webrev.5
>>
>> Here I'm correcting the rect after the transform in SG2D:
>>
>> 2123         // In case of negative scale transform, reflect the rect
>> coords.
>> 2124         if (w < 0) {
>> 2125             w *= -1;
>> 2126             x -= w;
>> 2127         }
>> 2128         if (h < 0) {
>> 2129             h *= -1;
>> 2130             y -= h;
>> 2131         }
>>
>>
>> The blit direction (dx, dy) remains transformed. Is this the right
>> behavior from your perspective?
>
> Yes, that looks good.  I wonder if the "w *= -1" results in a multiply byte code whereas "w = -w" 
> would avoid the multiply?
>
>             ...jim

Jim,

Yes, this indeed results in different byte code instructions (imult & ineg). Just for curiosity I 
did some measuring which showed negatioation worked 10% faster :)
Well, I'll fix it but let me please not send an update...

Thanks!
Anton.




More information about the 2d-dev mailing list