apple.awt.brushMetalLook support on OpenJDK7? - JNI solution?

Scott Kovatch scott.kovatch at oracle.com
Mon Apr 23 08:30:27 PDT 2012


On Apr 23, 2012, at 2:58 AM, Tobias Bley wrote:

> Thanks Hendrik, I know the report, voted and commented it ;)
> 
> But there is no acitvity since 5 month :( 
> 
> So I think about my own native solution in writing JNI code. My current problem is that with OpenJDK7 it's not possible to get the NSWindow from JavaWindow in Objective C code: The folling code only works on JDK6:

This is correct. You can't assume that you are hosted in an NSWindow anymore. The AWT in JDK 7 does not support the NSView/CG drawing that JDK 6 used; everything is CALayer-based now.

The platformInfo field is an NSObject that conforms to the JAWT_SurfaceLayers protocol:

@protocol JAWT_SurfaceLayers
@property (readwrite, retain) CALayer *layer;
@property (readonly) CALayer *windowLayer;
@end

It does look like we have some work left to do in the JAWT API, based on what I see in jdk/src/macosx/native/sun/awt/awt_DrawingSurface.m.

I'm also not completely sure why we removed access to the NSWindow. CALayers or not, you probably are going to be hosted in an NSWindow. Your main applet panel is the only case where you won't be.

Patches are always welcome. :-) 

-- Scott



More information about the macosx-port-dev mailing list