Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Several additions to the new display sync mechanism
- Adds IDisplaySynchronizer, which regroups the three types of sync expected (updating, realisation, rendering); - Simplifies further the update thread in LayeredDisplayView - Should fix issue #3166
- Loading branch information
1 parent
9b3df8f
commit 5f2a301
Showing
10 changed files
with
194 additions
and
230 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
msi.gama.core/src/msi/gama/common/interfaces/IDisplaySynchronizer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package msi.gama.common.interfaces; | ||
|
||
/** | ||
* A simple object that can synchronize the 3 threads in charge of the drawing of the displays: simulation thread | ||
* (simulation-view update mechanism), update thread, and rendering thread | ||
* | ||
* @author drogoul | ||
* | ||
*/ | ||
public interface IDisplaySynchronizer { | ||
/** | ||
* Allows any object calling this method to release the thread waiting for the scene to be rendered (called by the | ||
* rendering processes or when this surface is disposed) | ||
*/ | ||
void signalRenderingIsFinished(); | ||
|
||
/** | ||
* Makes any thread calling this method wait until either the scene is rendered or the surface is disposed | ||
*/ | ||
void waitForRenderingToBeFinished(); | ||
|
||
/** | ||
* Allows any object calling this method to release the thread waiting for the view to be updated | ||
*/ | ||
void authorizeViewUpdate(); | ||
|
||
/** | ||
* Makes any thread calling this method wait until can be updated | ||
*/ | ||
void waitForViewUpdateAuthorisation(); | ||
|
||
void waitForSurfaceToBeRealized(); | ||
|
||
void signalSurfaceIsRealized(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.