<Swing Dev> [9] Review request for 8176883 Enable antialiasing for Metal L&F icons on HiDPI display

Alexandr Scherbatiy alexandr.scherbatiy at oracle.com
Thu Mar 16 18:04:29 UTC 2017


   Hello,

   Could you review the updated fix:
     http://cr.openjdk.java.net/~alexsch/8176883/webrev.01

   - The SwingUtilities2.getAndSetAntialisingHintForScaledGraphics() 
sets the AA rendering hint only for local display.
   - The SwingUtilities2.setAntialiasingHintForScaledGraphics() method 
javadoc is updated to mention that the null AA rendering hint means that 
the passed graphics is not instance of Graphics2D.

On 3/16/2017 7:47 PM, Phil Race wrote:
>
> Hi,
>
> It looks to me as if this applies AA rendering even when you
> are drawing using G2D calls. Why ?
   I updated the methods javadoc. The passed aaHint to the method 
setAntialiasingHintForScaledGraphics() must be null for the non Graphics2D.
>
> Also this clearly only helps Metal. Is that because only Metal has 
> such problems ?
> I would doubt that.
>
> FWIW Motif L&F probably should not get this treatment.
    The The Windows L&F already uses the AA hints by the fix JDK-8165594.
    The GTK L&F uses only integer UI scale factor.
> Also if the desktop is "remote" we should avoid AA. I believe we do that
> for text with Metal so there should be example of how to detect that
> somewhere.
   I updated the fix.

   Thanks,
   Alexandr.
>
> -phil.
>
> On 03/16/2017 09:03 AM, Alexandr Scherbatiy wrote:
>>
>> Hello,
>>
>> Could you review the fix:
>>   bug: https://bugs.openjdk.java.net/browse/JDK-8176883
>>   webrev: http://cr.openjdk.java.net/~alexsch/8176883/webrev.00
>>
>>   Metal RadioButton and RadioButtonMenuItem icons are not drawn 
>> smoothly on HiDPI displays especially with floating point scales like 
>> 1.25 and 1.5.
>>   The fix enables the antialiasing rendering hint for the radio 
>> button and radio button menu item if the passed graphics is scaled.
>>
>>   The [1] folder contains screenshots how icons are drawn before the 
>> fix (on the left side) and after the fix (on the right side).
>>
>>   [1] http://cr.openjdk.java.net/~alexsch/8176883/screenshots/00
>>
>> Thanks,
>> Alexandr.
>>
>




More information about the swing-dev mailing list