Bug 922 - Unable to preserve resources during NewtCanvasAWT reparenting
Summary: Unable to preserve resources during NewtCanvasAWT reparenting
Status: RESOLVED FIXED
Alias: None
Product: Newt
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All windows
: --- normal
Assignee: Sven Gothel
URL:
Depends on:
Blocks:
 
Reported: 2013-12-11 04:29 CET by Michael
Modified: 2013-12-11 05:35 CET (History)
0 users

See Also:
Type: ---
SCM Refs:
a00406f289ebaaae8d91e9ccc980829f202421a8 45525950b0ad41b10790515c8b6142d746cd24f5
Workaround: ---


Attachments
Log with newt/jogl debugging (474.11 KB, text/plain)
2013-12-11 04:47 CET, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2013-12-11 04:29:11 CET
OS: Windows 7
Multiple monitor setup (Laptop w/ external monitor as primary device)

Setting GLWindow.preserveGLStateAtDestroy(true) has no effect during NewtCanvasAWT reparenting operation. jogamp.newt.WindowImpl uses wasVisible to determine resource preservation on destroy, however NewtCanvasAWT sets the GLWindow invisible before reparenting, thus always destroying GLContext.
Comment 1 Michael 2013-12-11 04:47:29 CET
Created attachment 566 [details]
Log with newt/jogl debugging

The logging describes the following setup. Two GLWindows, one with an animator, the other without. All logging before the "Before Switch" line involves initialization and adding the AnimatedGLWindow to the newtCanvas. After the line logs the switch/destruction of the AnimatedGLWindow for the second GLWindow.
Comment 2 Sven Gothel 2013-12-11 05:35:50 CET
a00406f289ebaaae8d91e9ccc980829f202421a8    
    NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via 
    new method variant using hints:
      - Add REPARENT_HINT_FORCE_RECREATION, covering 'old' forceDestroyCreate boolean argument
      - Add REPARENT_HINT_BECOMES_VISIBLE, Claim window becomes visible after reparenting, 
        which is important for e.g. preserving the GL-states in case window is invisible w
    
    Deprecate other reparentWindow(..) variants w/o hints.
    
    Use only new variant using hints w/o semantical change.

45525950b0ad41b10790515c8b6142d746cd24f5
   NEWT Window.reparentWindow(..): Use REPARENT_HINT_BECOMES_VISIBLE 
   to ensure GL State Preservation ; Add unit test !