--- old/src/share/classes/sun/awt/SunToolkit.java 2014-05-21 17:49:16.000000000 +0400 +++ new/src/share/classes/sun/awt/SunToolkit.java 2014-05-21 17:49:16.000000000 +0400 @@ -850,22 +850,30 @@ private int checkResolutionVariant(Image img, int w, int h, ImageObserver o) { ToolkitImage rvImage = getResolutionVariant(img); + int rvw = getRVSize(w); + int rvh = getRVSize(h); // Ignore the resolution variant in case of error return (rvImage == null || rvImage.hasError()) ? 0xFFFF : - checkImage(rvImage, 2 * w, 2 * h, MultiResolutionToolkitImage. + checkImage(rvImage, rvw, rvh, MultiResolutionToolkitImage. getResolutionVariantObserver( - img, o, w, h, 2 * w, 2 * h)); + img, o, w, h, rvw, rvh, true)); } private boolean prepareResolutionVariant(Image img, int w, int h, ImageObserver o) { ToolkitImage rvImage = getResolutionVariant(img); + int rvw = getRVSize(w); + int rvh = getRVSize(h); // Ignore the resolution variant in case of error return rvImage == null || rvImage.hasError() || prepareImage( - rvImage, 2 * w, 2 * h, + rvImage, rvw, rvh, MultiResolutionToolkitImage.getResolutionVariantObserver( - img, o, w, h, 2 * w, 2 * h)); + img, o, w, h, rvw, rvh, true)); + } + + private static int getRVSize(int size){ + return size == -1 ? -1 : 2 * size; } private static ToolkitImage getResolutionVariant(Image image) {