Lines 440-446
public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
Link Here
|
440 |
|
440 |
|
441 |
@Override |
441 |
@Override |
442 |
public void display() { |
442 |
public void display() { |
|
|
443 |
if( !validateGLDrawable() ) { |
444 |
if(DEBUG) { |
445 |
System.err.println(getThreadName()+": Info: GLCanvas display - skipped GL render, drawable not valid yet"); |
446 |
} |
447 |
return; // not yet available .. |
448 |
} |
443 |
Threading.invoke(true, displayOnEDTAction, getTreeLock()); |
449 |
Threading.invoke(true, displayOnEDTAction, getTreeLock()); |
|
|
450 |
|
444 |
awtWindowClosingProtocol.addClosingListenerOneShot(); |
451 |
awtWindowClosingProtocol.addClosingListenerOneShot(); |
445 |
} |
452 |
} |
446 |
|
453 |
|
Lines 570-591
public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
Link Here
|
570 |
if( _drawable.isRealized() ) { |
577 |
if( _drawable.isRealized() ) { |
571 |
return true; |
578 |
return true; |
572 |
} |
579 |
} |
573 |
if (!Beans.isDesignTime() && |
580 |
final RecursiveLock _lock = lock; |
574 |
0 < _drawable.getWidth() * _drawable.getHeight() ) { |
581 |
_lock.lock(); |
575 |
// make sure drawable realization happens on AWT EDT, due to AWTTree lock |
582 |
try { |
576 |
AWTEDTExecutor.singleton.invoke(getTreeLock(), true, setRealizedOnEDTAction); |
583 |
if (!Beans.isDesignTime() && |
577 |
if( _drawable.isRealized() ) { |
584 |
0 < _drawable.getWidth() * _drawable.getHeight() ) { |
578 |
sendReshape=true; // ensure a reshape is being send .. |
585 |
// make sure drawable realization happens on AWT EDT, due to AWTTree lock |
579 |
if(DEBUG) { |
586 |
AWTEDTExecutor.singleton.invoke(getTreeLock(), true, setRealizedOnEDTAction); |
580 |
System.err.println(getThreadName()+": Realized Drawable: "+_drawable.toString()); |
587 |
if( _drawable.isRealized() ) { |
581 |
Thread.dumpStack(); |
588 |
sendReshape=true; // ensure a reshape is being send .. |
|
|
589 |
if(DEBUG) { |
590 |
System.err.println(getThreadName()+": Realized Drawable: "+_drawable.toString()); |
591 |
Thread.dumpStack(); |
592 |
} |
593 |
return true; |
582 |
} |
594 |
} |
583 |
return true; |
|
|
584 |
} |
595 |
} |
|
|
596 |
} finally { |
597 |
_lock.unlock(); |
585 |
} |
598 |
} |
586 |
} |
599 |
} |
587 |
return false; |
600 |
return false; |
588 |
} |
601 |
} |
|
|
602 |
|
589 |
private Runnable setRealizedOnEDTAction = new Runnable() { |
603 |
private Runnable setRealizedOnEDTAction = new Runnable() { |
590 |
@Override |
604 |
@Override |
591 |
public void run() { |
605 |
public void run() { |
Lines 984-994
public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
Link Here
|
984 |
final RecursiveLock _lock = lock; |
998 |
final RecursiveLock _lock = lock; |
985 |
_lock.lock(); |
999 |
_lock.lock(); |
986 |
try { |
1000 |
try { |
987 |
if( validateGLDrawable() ) { |
1001 |
helper.invokeGL(drawable, context, displayAction, initAction); |
988 |
helper.invokeGL(drawable, context, displayAction, initAction); |
|
|
989 |
} else if(DEBUG) { |
990 |
System.err.println(getThreadName()+": Info: GLCanvas display - skipped GL render, drawable not valid yet"); |
991 |
} |
992 |
} finally { |
1002 |
} finally { |
993 |
_lock.unlock(); |
1003 |
_lock.unlock(); |
994 |
} |
1004 |
} |