Skip to main content

Questions about Graphics synchronization

1 reply [Last post]
sherikekele
Offline
Joined: 2010-05-06

Hi all,

Recently I encounter a problem about animation's up-to-date display.

I use DFB's window concept to implement the PBP AWT, thus, DFB window's flip function need to be called to see what the program has drawn.

I read the JAVA layer of AWT, found out Toolkit's sync() method is used to synchronize Graphics state. Toolkit's sync() method is trigger by UPDATE event in Component.java, whick is send out by repaint() method. So I use the flip() function to implement the native method of Toolkit's sync() method.

My understanding about Graphics synchronization is as follow:
repaint(called by application)->toolkit's sync()->native sync(flip)->graphics buffered update to screen

Am I right about the Graphics synchronization? I'm confused about the Graphics synchronization.
Can anyone help me about this issue? Thanks in advance.

Sheri

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi all,
>
> Recently I encounter a problem about animation's up-to-date display.
>
> I use DFB's window concept to implement the PBP AWT, thus, DFB window's flip function need to be called to see what the program has drawn.
>
> I read the JAVA layer of AWT, found out Toolkit's sync() method is used to synchronize Graphics state. Toolkit's sync() method is trigger by UPDATE event in Component.java, whick is send out by repaint() method. So I use the flip() function to implement the native method of Toolkit's sync() method.
>
> My understanding about Graphics synchronization is as follow:
> repaint(called by application)->toolkit's sync()->native sync(flip)->graphics buffered update to screen
>
> Am I right about the Graphics synchronization? I'm confused about the Graphics synchronization.
> Can anyone help me about this issue? Thanks in advance.
>

Hi Sheri,

The Toolkit sync() is useful for making sure the AWT graphics state is
in the same state same as the native side (in your case DFB) graphics
state. It is nice to have, but not necessary and usually just stubbed
out. The Graphics class (not the Toolkit class) is usually where all
the interesting update/repaint events are happening between the AWT Java
side and native side.

Take a look at an example port (such as the Qt port):

cdc/src/share/basis/classes/awt/qt/java/awt
QtToolkit.java
QtGraphics.java
*.java

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net