Review request for 7124236: [macosx] Some components lost shadows after the latest fix of translucent windows.

Sergey Bylokhov sergey.bylokhov at oracle.com
Wed Feb 1 10:39:07 PST 2012


Hi Dmitry, Mike.
A few notes:
  - After the fix we cannot control composite over background(see 
CompositeTest.java), it works on windows and on macosx on jdk6.
  - Graphics.getBackground() now returns transparent color so clearRect, 
paintAll(Graphics g) etc will work differently.

I have a few questions about these changes.
- Is it possible to replace composite from src_over to src between layer 
and nswindow? I think shadow will be fixed automatically if we change 
composite to src, because in this case we don`t need to set nswindow 
background to clearColor.
- If we set background of the window to clearcolor and paint something 
in drawRect, we will get correct shadow, but the shadow disappear if we 
paint the same things using layer. Why? Is it possible to make the same 
window using layers? 
http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html. 
Note: It has shadow and transparent to mouse clicks.

31.01.2012 23:04, Dmitry Cherepanov wrote:
> The cause of the problem with broken shadows is that currently 
> NSWindow's background color is [NSWindow clearColor] and it makes 
> shadows invisible. The fix implements Mike's suggestion and now we 
> draw pure transparent pixels into a CALayer so that the native 
> background color will be visible through transparent areas of the 
> CALayer.
>
> http://cr.openjdk.java.net/~dcherepanov/7124236/webrev.0/
>
> Thanks,
> Dmitry
>


-- 
Best regards, Sergey.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CompositeTest.java
Url: http://mail.openjdk.java.net/pipermail/macosx-port-dev/attachments/20120201/95a698ec/CompositeTest.java 


More information about the macosx-port-dev mailing list