<AWT Dev> Review request for 8143064 Icons are not properly rendered with Windows L&F on HiDPI display
alexandr.scherbatiy at oracle.com
Tue Jul 5 13:53:38 UTC 2016
Could you review the updated fix:
- the PainterMultiResolutionCachedImage.getWidth()/getHeight() methods
are overridden to not call the base resolution variant
- scale factors are added to the multi-resolution image
- component and args are set to the PainterMultiResolutionCachedImage
On 6/30/2016 11:38 AM, Semyon Sadetsky wrote:
> Hi Alexander,
> I have added printout after the line 679 of the XPStyle.java:
> 676 ThemeReader.paintBackground(SunWritableRaster.stealData(dbi, 0),
> 677 part.getControlName(c),
> 678 State.getValue(part, state),
> 679 0, 0, w, h, w);
> -->> System.out.println(w + " " + h + " " + part.getControlName(c) + "
> " + part.getValue() + " " + State.getValue(part, state));
> And it prints the same lines constantly when I repeatedly focus the
> test window without resizing it.
> It seems to me that the image caching doesn't work and the image is
> reconstructed each time from the native theme.
SunGraphics2D requests the multi-resolution image size which leads
that the base resolution image is recreated each time.
I fixed it overridden the getWidth()/getHeight() methods.
> Yet another question: why not use the actual scaling factor for the
> resolution variant instead of fixed 2X?
> On 6/29/2016 6:50 PM, Alexandr Scherbatiy wrote:
>> Could you review the updated fix:
>> The MultiResolutionImage image is used for the icons painting.
>> On 11/16/2015 7:07 PM, Sergey Bylokhov wrote:
>>> Hi, Alexander.
>>> 109 AffineTransform tx = ((Graphics2D) g).getTransform();
>>> 110 int sw = tx.isIdentity() ? w : (int) Math.round(w *
>>> 111 int sh = tx.isIdentity() ? h : (int) Math.round(h *
>>> I think that it is not necessary that !isIdentity transform return
>>> non-zero value from the getScaleX/Y method. I recall that exactly
>>> the same bug on OSX was fixed via MultiResolutionCachedImage, why we
>>> cannot do the same here?
>>> On 16.11.15 17:43, Alexander Scherbatiy wrote:
>>>> Could you review the fix:
>>>> bug: https://bugs.openjdk.java.net/browse/JDK-8143064
>>>> webrev: http://cr.openjdk.java.net/~alexsch/8143064/webrev.00
>>>> Icon image sizes are scaled in sun.swing.CachedPainter.
More information about the awt-dev