JDK-5043715 : OGL: Resizing a frame distorts the volatile image rendered on the frame
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-05-07
  • Updated: 2005-08-18
  • Resolved: 2005-08-18
Related Reports
Relates :  
Description
I am rendering a translucent volatile image onto a frame and executing this with opengl flag turned on. I am getting a message on the console saying opengl pipeline is enabled. When I resize the frame, the image rendered on it is getting totally distorted and the frame is not getting repainted properly. I noticed this on WinXP Prof with NVIDIA GEFORCE4 MX440 video card. This is reproducible right from Tiger-beta2-b46 and not occuring on previous builds since opengl feature was not available. This is not reproducible with 'sun.java2d.noddraw=true' flag. 

Execute the attached sample test by passing an image file in the command line. Make sure OpenGL is enabled by looking at the console message. Resize the frame. If the repaint does not occur properly and if the image gets distorted, the bug is reproduced. This is reproduced with Java2Demo also.

Comments
EVALUATION This bug was filed against Tiger, but a separate bug (6290245) was filed in Mustang regarding similar problems when resizing with dynamic layout enabled (which was made the default behavior on Windows after Mustang b40). This bug therefore pertains specifically to the case where dynamic layout is disabled. As mentioned in the comments, the problem is that while a frame is being resized on Windows, the SurfaceData bounds will reflect the window bounds before the resize operation started. For the OGL pipeline, it is important that the SurfaceData bounds are updated in realtime as the actual window bounds are changing because we need to keep the OpenGL viewport in sync with the window bounds. A complicating factor on Windows is that the OpenGL viewport will track the lower-left corner of a frame as it is being resized, so the contents of the frame will be repainted relative to the lower-left corner, instead of the upper-left corner, which is of course the expected behavior. So the only way to fix this is essentially what dynamic layout offers in Mustang: a way to replace the SurfaceData for each WM_SIZING event as the window is being resized. Since dynamic layout is now the default behavior in Windows (and the issues reported in 6290245 have been fixed in b51), and it is unlikely that applications will disable dynamic layout (esp. those using the OGL pipeline), I suggest that we close this bug as "not reproducible" since it will no longer be reproducible as of Mustang b51.
18-08-2005

EVALUATION Not Tiger. ###@###.### 2004-05-10
10-05-2004