JDK-5062995 : AWT needs to support Shaped windows and components.
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2004-06-14
  • Updated: 2009-03-10
  • Resolved: 2009-03-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Description
All current windowing platforms support Shaping a top level window. 
java.awt.Window needs to support the ability to setShape so that the top
level window shape can be controlled. Windows has supported this API for
a very long time and X11 has the Shape extension to do this. Ofcourse
the API should also be able to query if the platform does support the
Shape functionality (in case Shape extension is not present, probably
very unlinkely, I have not seen any X-Server that does not have this).

Heavyweight components should be able to set their shape (atleast internal
to AWT). This is necessary to implement HW/LW mixing.

I have already prototyped a simple implementation of this API. Attached are the
webrevs for this prototype. It is part of the HW/LW mixing project we did.

Attached is a PDF file with the X11 Shape documentation :
http://www.xfree86.org/current/shapelib.pdf

As you can see this API has been in existence since 1989 !

Below is Win32 doc for SetWindowRgn :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_2him.asp


Attached is also a cool example of using the Shape extension (this worked
with my prototype.)

###@###.### 2004-06-14

Comments
EVALUATION The CR 6633275 has been delivered to 6u10 and 7. The public API for this feature is covered by 6802853. However, this fix covers shaped top level windows only. Should need arise for shaped components, a separate CR has to be filed.
10-03-2009

EVALUATION Using the prototypes from ###@###.### we tested shapes on different platform with different settings. --------------- Windows (###@###.###)----------------- No problems were found in implementation. Only one reasonable way of implementation exists (SetWindowRgn) and it works perfectly. No significant performance degradation was detected. SwingMark test shows approx. 10% performance degradation with a complex shape (ellipse) assigned to its frame, the reason for that is that Windows internal representation for regions of this type uses a separate rectangle for each scanline. Rectangular shapes give no degradation (performance may even increase due to extra clipping). No conflicts with DirectDraw/D3D acceleration were found (unable to test OpenGL as the implementation in the current build does not seem to work stably on Windows - Java crashed). Both top-level and individual heavyweight Component's shapes were tested, no problems were found. (Side note: SwingMark with DirectDraw is 1-2% faster than GDI on this machine, P4 2.4/1G/Radeon 7000) ###@###.### 2004-11-16 13:11:46 GMT ###@###.### collected the information about X11 testing, it can be found here: http://jcg-linux-03/tiki/tiki-index.php?page=ShapedWindowRFE ###@###.### 2004-11-16 16:02:49 GMT
16-11-2004