From 608c418afe2b4e04b52bedbaa2765c44bd3bd6dd Mon Sep 17 00:00:00 2001 From: serb Date: Fri, 10 Oct 2014 16:07:18 +0400 Subject: [PATCH] 8059943: [macosx] Aqua LaF should use BI.TYPE_INT_ARGB_PRE for a better performance Reviewed-by: alexsch, azvegint --- src/macosx/classes/com/apple/laf/AquaIcon.java | 2 +- src/macosx/classes/com/apple/laf/AquaImageFactory.java | 2 +- src/macosx/classes/com/apple/laf/AquaNativeResources.java | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/macosx/classes/com/apple/laf/AquaIcon.java b/src/macosx/classes/com/apple/laf/AquaIcon.java index 4af5599b6..3a24c35e2 100644 --- a/src/macosx/classes/com/apple/laf/AquaIcon.java +++ b/src/macosx/classes/com/apple/laf/AquaIcon.java @@ -62,7 +62,7 @@ public class AquaIcon { 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(); diff --git a/src/macosx/classes/com/apple/laf/AquaImageFactory.java b/src/macosx/classes/com/apple/laf/AquaImageFactory.java index d19486395..28977cb6e 100644 --- a/src/macosx/classes/com/apple/laf/AquaImageFactory.java +++ b/src/macosx/classes/com/apple/laf/AquaImageFactory.java @@ -129,7 +129,7 @@ public class AquaImageFactory { }; 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); diff --git a/src/macosx/classes/com/apple/laf/AquaNativeResources.java b/src/macosx/classes/com/apple/laf/AquaNativeResources.java index e0e7c41db..f87037ed6 100644 --- a/src/macosx/classes/com/apple/laf/AquaNativeResources.java +++ b/src/macosx/classes/com/apple/laf/AquaNativeResources.java @@ -66,11 +66,12 @@ public class AquaNativeResources { } 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; } -- GitLab