Summary: | Resize GLCanvas broken on OSX and JDK7 | ||
---|---|---|---|
Product: | [JogAmp] Jogl | Reporter: | jost <jost0x2c> |
Component: | macosx | Assignee: | Sven Gothel <sgothel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gouessej |
Priority: | --- | ||
Version: | 2 | ||
Hardware: | pc_x86_64 | ||
OS: | macosx | ||
Type: | --- | SCM Refs: |
jogl c03ad260aea0b4a640a5eeb50a206688c531b591
jogl d10c7916a2444b6cb1cf45be3ccb3d6e91a2f1b4
jogl 0d7c3ed619044723cf561df424eac9992e5281c7
jogl c50fca1b5df9ec3b76fada4dd5dd307bdece531a
jogl 9a7c8896fe38ebcd42ed5238b09a7a36d46db9dc
|
Workaround: | --- | ||
Attachments: |
screenshot
test1.log test2.log |
Description
jost
2012-06-16 14:16:07 CEST
Created attachment 351 [details]
test1.log
Created attachment 352 [details]
test2.log
Do you reproduce the same problem with a plan java.awt.Canvas? I would like to know whether this bug really comes from JOGL (or from AWT). No, adding the canvas below to a java.awt.Frame paints and resizes as expected: public static class SimpleCanvas extends java.awt.Canvas { @Override public void paint(Graphics g) { int w = getWidth(); int h = getHeight(); g.setColor(Color.RED); g.fillOval(10, 10, w - 20, h - 20); } } Added unit tests (enhancements and new ones) trying to [visually] cover this situation using screenshots. See JOGL commit c03ad260aea0b4a640a5eeb50a206688c531b591, especially test case: com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02AWT Let's use these screenshots and test cases to analyze the behavior. Your setup: - Mac OS X 10.7.4 (os), - Java Version: 1.7.0_06-ea, VM: Java HotSpot(TM) 64-Bit Server VM - GL_RENDERER NVIDIA GeForce 9400M OpenGL Engine GL_VERSION 2.1 NVIDIA-7.18.18 GLSL true, has-compiler: true, version: 1.20 Ours default: <https://jogamp.org/chuck/job/jogl/770/label=macosx-10_6-x86_64-nvidia/consoleText> - Mac OS X 10.7.4 (os), - Java Version: 1.6.0_33, VM: Java HotSpot(TM) 64-Bit Server VM - GL_RENDERER NVIDIA GeForce 320M OpenGL Engine GL_VERSION 2.1 NVIDIA-7.18.18 GLSL true, has-compiler: true, version: 1.20 Will also test w/ Java 1.7* ofc. .. Lets check the results of the new builds staring from b771: <https://jogamp.org/chuck/view/fwd/job/jogl/771/> Test files and log (sections) of interest: - com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02AWT - TestGLReadBufferUtilTextureIOWrite02AWT.*.png (In reply to comment #5) > > com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02AWT Above test triggers a NPE (w/ offscreen layer use, resize -> recreate) .. The new tests allows us to nail it down, stay tuned :) (In reply to comment #6) > (In reply to comment #5) > > > > com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02AWT > > Above test triggers a NPE (w/ offscreen layer use, resize -> recreate) .. > The new tests allows us to nail it down, stay tuned :) Fixed the NPE, good cleanup for stability catching destruction cases unhandled yet. Now the test case reproduces your experience w/ java7 while working flawless w/ java6 - both using the offscreen layering. (Ofc w/ java7 no onscreen rendering is available) Minor note: the resize width is wrong on OSX. +++ Interesting piece is that even though the screenshot does show a resized picture, but on the actual screen it stays small. In some test run it freezes/deadlocks at: AWT-EventQueue-0: at jogamp.opengl.macosx.cgl.CGL.setNSOpenGLLayerSwapInterval(Native Method) at jogamp.opengl.macosx.cgl.MacOSXCGLContext$NSOpenGLImpl.setSwapInterval(MacOSXCGLContext.java:589) at jogamp.opengl.macosx.cgl.MacOSXCGLContext.setSwapIntervalImpl(MacOSXCGLContext.java:296) at javax.media.opengl.GLContext.setSwapInterval(GLContext.java:628) at jogamp.opengl.gl4.GL4bcImpl.setSwapInterval(GL4bcImpl.java:34143) at com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2.init(GearsES2.java:177) +++ Will dig into it deeper .. Fixed. OSXUtil.CreateCALayer*(..) needs to have the layer target size (if known) otherwise it's possible openjdk7 uses a zero sized CALayer. +++ Tested against: openjdk version "1.7.0-jdk7u5-b30" OpenJDK Runtime Environment (build 1.7.0-jdk7u5-b30-20120621) OpenJDK 64-Bit Server VM (build 23.2-b05, mixed mode) and java version "1.6.0_33" Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720) Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode) Thanks! I can confirm the fix with my setup. Though there still is a difference between jdk6 and jdk7. During resizing with jdk7 the canvas is flickering heavily, in fact, when resizing its more like the animation disappears and reappears after resizing has finished. jdk6 resizing goes smoothly without disturbing the animation and without any noticeable flickering. |