8059943: [macosx] Aqua LaF should use BI.TYPE_INT_ARGB_PRE for a better performance
Reviewed-by: alexsch, azvegint
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java Fri Oct 10 11:36:26 2014 +0400
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java Fri Oct 10 16:07:18 2014 +0400
@@ -62,7 +62,7 @@
if (w <= 0 || h <= 0) return null;
// This could be any kind of icon, so we need to make a buffer for it, draw it and then pass the new image off to appkit.
- final BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
+ final BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB_PRE);
final Graphics g = image.getGraphics();
i.paintIcon(null, g, 0, 0);
g.dispose();
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Fri Oct 10 11:36:26 2014 +0400
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java Fri Oct 10 16:07:18 2014 +0400
@@ -129,7 +129,7 @@
};
final BufferedImage image = new BufferedImage(scaledAlertIconSize,
- scaledAlertIconSize, BufferedImage.TYPE_INT_ARGB);
+ scaledAlertIconSize, BufferedImage.TYPE_INT_ARGB_PRE);
final Graphics g = image.getGraphics();
g.drawImage(background, 0, 0,
scaledAlertIconSize, scaledAlertIconSize, null);
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java Fri Oct 10 11:36:26 2014 +0400
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java Fri Oct 10 16:07:18 2014 +0400
@@ -67,11 +67,12 @@
}
static BufferedImage getRadioButtonSizerImage() {
- final BufferedImage img = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB);
+ final BufferedImage img = new BufferedImage(20, 20, BufferedImage.TYPE_INT_ARGB_PRE);
Graphics g = img.getGraphics();
g.setColor(Color.pink);
g.fillRect(0, 0, 20, 20);
+ g.dispose();
return img;
}