changeset 10757:4108c46e4cea

8059943: [macosx] Aqua LaF should use BI.TYPE_INT_ARGB_PRE for a better performance Reviewed-by: alexsch, azvegint
author serb
date Fri, 10 Oct 2014 16:07:18 +0400
parents 8d45ad1c2672
children 8278952344bc
files src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java
diffstat 3 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/macosx/classes/com/apple/laf/AquaIcon.java	Fri Oct 10 11:36:26 2014 +0400
+++ b/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/src/java.desktop/macosx/classes/com/apple/laf/AquaImageFactory.java	Fri Oct 10 11:36:26 2014 +0400
+++ b/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/src/java.desktop/macosx/classes/com/apple/laf/AquaNativeResources.java	Fri Oct 10 11:36:26 2014 +0400
+++ b/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;
     }