--- a/jdk/src/share/classes/sun/awt/SunToolkit.java Fri May 23 11:13:54 2014 -0700
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java Mon May 26 14:33:49 2014 +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) {