From 9ea4ab4133f05c27f588716e06518431b46b0b17 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Mon, 21 May 2012 14:04:46 +0400 Subject: [PATCH 1/2] 7124400: [macosx] CGraphicsDevice.getConfigurations() returns reference to member (does not copy configs) Reviewed-by: anthony, kizune --- jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java | 6 +++--- jdk/test/java/awt/GraphicsDevice/CloneConfigsTest.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java b/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java index 1fda340c509..02f743d3e72 100644 --- a/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java +++ b/jdk/src/macosx/classes/sun/awt/CGraphicsDevice.java @@ -40,7 +40,7 @@ public class CGraphicsDevice extends GraphicsDevice { private final int displayID; // Array of all GraphicsConfig instances for this device - private final CGraphicsConfig[] configs; + private final GraphicsConfiguration[] configs; // Default config (temporarily hard coded) private final int DEFAULT_CONFIG = 0; @@ -49,7 +49,7 @@ public class CGraphicsDevice extends GraphicsDevice { public CGraphicsDevice(int displayID) { this.displayID = displayID; - configs = new CGraphicsConfig[] { + configs = new GraphicsConfiguration[] { CGLGraphicsConfig.getConfig(this, 0) }; } @@ -66,7 +66,7 @@ public class CGraphicsDevice extends GraphicsDevice { */ @Override public GraphicsConfiguration[] getConfigurations() { - return configs; + return configs.clone(); } /** diff --git a/jdk/test/java/awt/GraphicsDevice/CloneConfigsTest.java b/jdk/test/java/awt/GraphicsDevice/CloneConfigsTest.java index c124ff5f434..29c3aa9b575 100644 --- a/jdk/test/java/awt/GraphicsDevice/CloneConfigsTest.java +++ b/jdk/test/java/awt/GraphicsDevice/CloneConfigsTest.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6822057 + * @bug 6822057 7124400 * * @summary Test verifies that list of supported graphics configurations * can not be changed via modification of elements of an array From ecf06b34593b06009308c51b6822a3fefcf62cb1 Mon Sep 17 00:00:00 2001 From: Andrew Brygin Date: Mon, 21 May 2012 14:53:51 +0400 Subject: [PATCH 2/2] 7154088: [macosx] Regression: Component.createImage do not inherits component attributes Reviewed-by: art, kizune --- jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java index a7b15e07c96..6701434bb20 100644 --- a/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java +++ b/jdk/src/macosx/classes/sun/lwawt/LWComponentPeer.java @@ -940,8 +940,8 @@ public abstract class LWComponentPeer @Override public Image createImage(int w, int h) { - // TODO: accelerated image - return getGraphicsConfiguration().createCompatibleImage(w, h); + CGraphicsConfig gc = (CGraphicsConfig)getGraphicsConfiguration(); + return gc.createAcceleratedImage(getTarget(), w, h); } @Override