On Tue, 26 Apr 2022 22:06:09 GMT, Alexander Zuev <kiz...@openjdk.org> wrote:
>> Detect the situation where we do need to perform interpolation during >> ImageIcon >> painting and set a hint to the rendering to perform bicubic approximation so >> image details are preserved during transition. > > Alexander Zuev has updated the pull request incrementally with one additional > commit since the last revision: > > Take into account scale factor; > Create a new Graphics2D object instead of juggle the rendering hints; Ok, i have modified PR to use the scale factor to determine if we will need the scaling operation at all and i'm creating a new Graphics2D object so i do not need to swap the rendering hints. Saying that BICUBIC is expensive - i have found any noticeable performance impact when using this code. And it is not always the scale down that needs this hint - even scaling up of the icons when scaling factor is set to 125 or 175% gives much better result for icons that do not have the exact match in size for the said scaling. ------------- PR: https://git.openjdk.java.net/jdk/pull/7805