aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2012-12-28 14:10:14 +0100
committerSven Gothel <[email protected]>2012-12-28 14:10:14 +0100
commitd93c5d23e304ea20e868595748f92a5bef4f5703 (patch)
treec3c6f8d5c8a16e56e7aa22d70dc808a7d4e4e3db /src/jogl/classes/javax/media
parentf514582845efaf2bf41cbcbeb1e2378d224b11a3 (diff)
AWT GLCanvas: More strict GLDrawable realization [on AWT-EDT], skip if creation is not possible on AWT-EDT.
The Intel HD3000 OpenGL driver on Windows will deadlock @ SwapBuffers in case the drawable is created on a thread other than the window owner thread. We are aware of such possibilities, nevertheless the AWTEDTExecutor.singleton.invoke(..) allowed to execute the runnable in case it cannot be invoked on AWT-EDT. The latter is the case if the current thread is not the AWT-EDT _and_ is holding the AWT tree-lock. With GlueGen commit 0b43b43f889ad7fc220942b0076e2001ca3cf13f, the invoke method now consumes an argument allowing to restrict the execution to AWT-EDT only. In such case, the drawable will be realized at a later time from the AWT-EDT. Such a situation could be triggered if a Frame's setVisible(true) is not issued from the AWT-EDT, as it should be! However, to relax such use cases - we better recognize such possible dealock and avoid it.
Diffstat (limited to 'src/jogl/classes/javax/media')
-rw-r--r--src/jogl/classes/javax/media/opengl/awt/GLCanvas.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index efdc69ed8..2f7fef9be 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -580,14 +580,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
if( Beans.isDesignTime() || !isDisplayable() || 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) {
return false; // early out!
}
- // make sure drawable realization happens on AWT EDT, due to AWTTree lock
- AWTEDTExecutor.singleton.invoke(getTreeLock(), true, setRealizedOnEDTAction);
- final boolean res = _drawable.isRealized();
+ // Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
+ final boolean res0 = AWTEDTExecutor.singleton.invoke(getTreeLock(), false /* allowOnNonEDT */, true /* wait */, setRealizedOnEDTAction);
+ final boolean res1 = res0 && _drawable.isRealized();
if(DEBUG) {
- System.err.println(getThreadName()+": Realized Drawable: "+res+", "+_drawable.toString());
+ System.err.println(getThreadName()+": Realized Drawable: invoked "+res0+", probedIsRealized "+res1+", "+_drawable.toString());
Thread.dumpStack();
}
- return res;
+ return res1;
}
return false;
}
@@ -879,7 +879,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
",\n\thandle 0x"+Long.toHexString(getHandle())+
",\n\tDrawable size "+dw+"x"+dh+
",\n\tAWT pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
- ",\n\tvisible "+isVisible()+
+ ",\n\tvisible "+isVisible()+", displayable "+isDisplayable()+
",\n\t"+awtConfig+"]";
}
@@ -949,7 +949,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
validateGLDrawable(); // immediate attempt to recreate the drawable
} else {
if(null != awtConfig) {
- AWTEDTExecutor.singleton.invoke(getTreeLock(), true, disposeAbstractGraphicsDeviceActionOnEDT);
+ AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, disposeAbstractGraphicsDeviceActionOnEDT);
}
awtConfig=null;
}
'>275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
                 
  <meta content="text/html; charset=windows-1252"
 http-equiv="Content-Type">
                 
  <meta content="MSHTML 5.00.2920.0" name="GENERATOR">
  <title></title>
</head>
  <body bgcolor="#f5f5f5">
         
<div Align=center> 
  <img ID="NavBar" WIDTH=800 HEIGHT=32 SRC="https://games.dev.java.net/images/navbar2p.gif" VSPACE=0 HSPACE=0 ALIGN="TOP" BORDER=0 USEMAP="#NavBar_MAP" NOFINSIDE="~!   ~!" > </div>
  
<MAP NAME="NavBar_Map">
  <AREA SHAPE="rect" ALT="Projects" COORDS="356,7,440,23" HREF="https://games.dev.java.net" TARGET="_self">
  <AREA SHAPE="rect" ALT="Wiki" COORDS="643,7,695,23" HREF="http://wiki.java.net/bin/view/Games">
  <AREA SHAPE="rect" ALT="Weblogs" COORDS="562,7,624,23" HREF="http://weblogs.java.net/weblogs/project/games">
  <AREA SHAPE="rect" COORDS="463,7,541,23" HREF="http://192.18.37.44/forums/index.php" target="_top" ALT="Forums">
  <AREA SHAPE="rect" ALT="JavaGames Home" COORDS="147,7,334,23" HREF="http://community.java.net/games">
  <AREA SHAPE="rect" ALT="Java.net" COORDS="21,7,128,23" HREF="http://www.java.net" TARGET="_self">
</MAP>

<div align="center"><font color="#005177" size="+2">Welcome to the JOGL API
   Project! </font></div>
         
<table border="0" cellpadding="0" cellspacing="1" width="100%">
       <tbody>
       <tr>
         <td valign="top" width="66%">                                  
      <table border="0" cellpadding="5" cellspacing="1" height="358"
 width="100%">
             <tbody>
             <tr>
               <td valign="top">                                        
                        
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" valign="top" width="589">    
                                                                        
                 
                  <div align="left"><font color="#ffffff"><strong>Overview</strong></font></div>
                      </td>
                    </tr>
                   <tr>
                     <td bgcolor="#F8F8F8" valign="top">                
                                                                        
     
                  <div align="justify">                                  
                                                            
                  <p>

The JOGL project hosts the development version of the Java Bindings
for OpenGL (<a
href="http://jcp.org/en/jsr/detail?id=231">JSR-231</a>), and is
designed to provide hardware-supported 3D graphics to applications
written in Java. JOGL is not the official reference implementation of
the JSR, but an evolving workspace; snapshots are taken from this
workspace which become the official reference implementations of the
JSR. JOGL is part of a suite of open-source technologies initiated by
the Game Technology Group at Sun Microsystems.

                  <p>JOGL provides full access to the APIs in the OpenGL
2.0 specification as well as nearly all vendor extensions, and integrates
with the AWT and Swing widget sets.<br>
                   </p>
                   
                  <p>Please see the <a
 href="https://jogl-demos.dev.java.net/">JOGL demos</a> for illustrations of
advanced OpenGL techniques now possible with the Java platform.<br>
                   </p>
                     </div>
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>
             <tr>
               <td>                                                     
           
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" width="589">                 
                                                                        
    
                  <div align="left"><font color="#ffffff"><strong>Project
                     Status</strong></font></div>
                      </td>
                    </tr>
                   <tr>
                     <td bgcolor="#F8F8F8">                             
                                                                 
                  <div align="justify">The intial implementation of the JOGL
                     API is available for download from <a
 href="https://jogl.dev.java.net/source/browse/jogl/">CVS</a>.           
    </div>
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>
             <tr>
               <td>                                                     
           
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" width="589">                 
                                                                        
    
                  <div align="left"><font color="#ffffff"><strong>Getting
  Started                    </strong></font></div>
                      </td>
                    </tr>
                   <tr>
                     <td bgcolor="#F8F8F8" valign="top">                
                                                                        
     
                  <p>This project has been built in the following       
            environments. All require the <a
 href="http://www.antlr.org/">ANTLR</a> parser generator and the <a
 href="http://ant.apache.org/">Ant</a> build system version 1.6 or later to be installed; please
see the <a
 href="https://jogl.dev.java.net/unbranded-source/browse/*checkout*/jogl/doc/HowToBuild.html?rev=HEAD&amp;content-type=text/html">build
documentation</a> for details. </p>
                                                                        
                          
                  <ul>
     		    <li> Solaris                                                 
                                                               
                      <ul>
                            <li> <a
 href="http://www.sun.com/software/solaris/">Solaris         
             8 or later</a>  		      </li>
                            <li> <a
 href="http://www.sun.com/software/products/studio/">Sun        
              ONE Studio 8 Compiler Collection or later</a> 		       		      </li>
                            <li> <a
 href="http://www.sun.com/software/graphics/opengl/">Sun     
                 OpenGL for Solaris</a> (or <a href="http://www.mesa3d.org/">Mesa</a> for Solaris 9 x86)  		      </li>
                            <li> <a
 href="http://java.sun.com/j2se/1.4.2/">Sun  J2SDK 		      1.4.2 or later</a>     
                </li>
                                                                         
                     
                      </ul>
      		    </li>
                        <li> Linux                                      
                                                                        
 
                      <ul>
                           <li> Red Hat Linux 7.3 for x86 or later 		      </li>
                            <li> GCC 		      </li>
                            <li> <a
 href="http://java.sun.com/j2se/1.4.2/">Sun  J2SDK 		      1.4.2 or later</a> 		  
 </li>
                                                                         
                     
                      </ul>
      		    </li>
                        <li> Macintosh                                  
                                                                        
     
                      <ul>
                           <li> Mac OS X 10.3 (note:
                      will not work with earlier releases)  		      </li>
                            <li> GCC  		      </li>
                            <li> <a href="http://www.apple.com/java/">Java
 		       1.4.2 or later for Mac OS X</a> 		    </li>
                                                                         
                     
                      </ul>
      		    </li>
                        <li> Windows                                    
                                                                        
   
                      <ul>
                           <li> Windows 2000 or later for x86  		      </li>
                            <li> Microsoft Visual C++                   
   6.0 or later, or <a href="http://www.mingw.org/">MinGW</a> compilers  		 
    </li>
                            <li> <a
 href="http://java.sun.com/j2se/1.4.2/">Sun  J2SDK                       1.4.2 or later</a>
 		    </li>
                                                                         
                     
                      </ul>
                                                                        
                                      
                      <p></p>
                        </li>
                                                                        
      
                  </ul>
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>
                                       
        </tbody>                            
      </table>
                                       
      <p></p>
          </td>
         <td valign="top">                                   
      <table border="0" cellpadding="5" cellspacing="1" width="100%">
             <tbody>
             <tr>
               <td>                                                     
           
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" valign="top">                
                                                                        
     
                  <div align="left"><font color="#ffffff"><strong>Useful
                   Links</strong></font></div>
                      </td>
                    </tr>
                   <tr>
                      <td valign="top" bgcolor="#F8F8F8">               
                                                           
                  <ul>
                         <li><a href="http://www.opengl.org"
 target="_blank">OpenGL</a>                        Home</li>
                        <li><a href="https://jogl-demos.dev.java.net/">JOGL
 Demos</a></li>
                        <li><a
 href="ts1361.pdf">JOGL
  JavaOne 2004 Presentation Slides</a></li>
                        <li><a
 href="2125.pdf">JOGL
  JavaOne 2003 Presentation Slides</a></li>
                       <li><a
 href="http://192.18.37.44/forums/index.php?board=25.0">JOGL 
 Forums</a></li>
                       <li><a
 href="https://jogl.dev.java.net/unbranded-source/browse/*checkout*/jogl/doc/userguide/index.html?rev=HEAD&content-type=text/html">JOGL User's Guide</a></li>
                      <li><a
 href="3167.pdf">JavaOne
 2002 Slides</a> on <a href="http://jausoft.com/gl4java/">OpenGL for Java</a><br>
                      </li>
                      <li><a
 href="sun_contributor_agreement.pdf">Sun Contributor Agreement</a><br>
                      </li>
                                                                        
                        
                  </ul>
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>
              <tr>
               <td>                                                     
           
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" valign="top">                
                                                                        
     
                  <div align="left"><font color="#ffffff"><strong>Downloads</strong></font></div>
                      </td>
                    </tr>
                   <tr>
                      <td valign="top" bgcolor="#F8F8F8">               
                                                           
                  <ul>
                         <li><a
 href="https://jogl.dev.java.net/servlets/ProjectDocumentList"
 target="_blank">Precompiled binaries and documentation</a></li>
                                                                        
                        
                  </ul>
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>

             <tr>
               <td>                                                     
           
            <table bgcolor="#6E94B7" border="0" cellpadding="5"
 cellspacing="1" width="100%">
                   <tbody>
                   <tr>
                     <td bgcolor="#6E94B7" width="589">                 
                                                                        
    
                  <div align="left"><font color="#ffffff"><strong>Current nightly build</strong></font></div>
                      </td>
                    </tr>
                   <tr>
                     <td bgcolor="#F8F8F8">                             

<!- BEGIN NIGHTLY -->
<TABLE CELLPADDING=3>
<TR> <TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/javadoc_public/>Browsable javadoc</A></TD></TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl.jar> jogl.jar  </A></TD>
<TD>  863363  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-natives-linux.jar> jogl-natives-linux.jar  </A></TD>
<TD>  172223  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-natives-macosx.jar> jogl-natives-macosx.jar  </A></TD>
<TD>  120731  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-natives-solsparc.jar> jogl-natives-solsparc.jar  </A></TD>
<TD>  196155  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-natives-solx86.jar> jogl-natives-solx86.jar  </A></TD>
<TD>  175890  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-natives-win32.jar> jogl-natives-win32.jar  </A></TD>
<TD>  53950  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-src.zip> jogl-src.zip  </A></TD>
<TD>  1191967  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-demos.jar> jogl-demos.jar  </A></TD>
<TD>  259487  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-demos-data.jar> jogl-demos-data.jar  </A></TD>
<TD>  7875081  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-demos-util.jar> jogl-demos-util.jar  </A></TD>
<TD>  142439  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
<TR>
<TD> <A HREF=http://download.java.net/media/jogl/builds/nightly/jogl-demos-src.zip> jogl-demos-src.zip  </A></TD>
<TD>  8215457  bytes </TD>
<TD>  2005-11-09 05:15  </TD>
</TR>
</TABLE>
<!- END NIGHTLY -->
                                                                 
                      </td>
                    </tr>
                                                               
              </tbody>                                                  
 
            </table>
                </td>
              </tr>

                                                 
        </tbody>                            
      </table>
          </td>
        </tr>
               
  </tbody>    
</table>
</body>
</html>