display: one more update while display skipping
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 4 Apr 2013 06:27:08 +0000 (15:27 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 4 Apr 2013 06:31:57 +0000 (15:31 +0900)
do one more update for sdl display surface
while skipping of framebuffer drawing.

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkinState.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/PhoneShapeSkinComposer.java

index 6744202..c0d8db8 100644 (file)
@@ -181,7 +181,7 @@ public class EmulatorSkin {
        public CustomProgressBar bootingProgress;
        public ScreenShotDialog screenShotDialog;
 
-       protected SocketCommunicator communicator;
+       public SocketCommunicator communicator;
        private ShellListener shellListener;
        private MenuDetectListener shellMenuDetectListener;
 
index f9f94d1..4f55a8c 100644 (file)
@@ -135,11 +135,11 @@ public class EmulatorSkinState {
                this.displayBounds = bounds;
        }
 
-       public synchronized boolean isUpdateDisplayBounds() {
+       public synchronized boolean isNeedToUpdateDisplay() {
                return updateDisplayBounds;
        }
 
-       public synchronized void setUpdateDisplayBounds(boolean needUpdate) {
+       public synchronized void setNeedToUpdateDisplay(boolean needUpdate) {
                this.updateDisplayBounds = needUpdate;
        }
 
index fe317df..08e75c4 100644 (file)
@@ -48,6 +48,8 @@ import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.skin.EmulatorSkin;
 import org.tizen.emulator.skin.EmulatorSkinState;
 import org.tizen.emulator.skin.comm.ICommunicator.RotationInfo;
+import org.tizen.emulator.skin.comm.ICommunicator.SendCommand;
+import org.tizen.emulator.skin.comm.sock.data.DisplayStateData;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
 import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants;
@@ -297,6 +299,7 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                /* custom window shape */
                trimPatchedShell(shell, currentState.getCurrentImage());
 
+               currentState.setNeedToUpdateDisplay(true);
                shell.redraw();
        }
 
@@ -363,6 +366,16 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
                shellPaintListener = new PaintListener() {
                        @Override
                        public void paintControl(final PaintEvent e) {
+                               if (currentState.isNeedToUpdateDisplay() == true) {
+                                       currentState.setNeedToUpdateDisplay(false);
+
+                                       /* Let's do one more update for sdl display surface
+                                       while skipping of framebuffer drawing */
+                                       DisplayStateData lcdStateData = new DisplayStateData(
+                                                       currentState.getCurrentScale(), currentState.getCurrentRotationId());
+                                       skin.communicator.sendToQEMU(SendCommand.CHANGE_LCD_STATE, lcdStateData);
+                               }
+
                                /* general shell does not support native transparency,
                                 * so draw image with GC. */
                                if (currentState.getCurrentImage() != null) {
index 21eeeea..349d35c 100644 (file)
@@ -52,6 +52,7 @@ import org.tizen.emulator.skin.EmulatorSkinState;
 import org.tizen.emulator.skin.comm.ICommunicator.KeyEventType;
 import org.tizen.emulator.skin.comm.ICommunicator.SendCommand;
 import org.tizen.emulator.skin.comm.sock.SocketCommunicator;
+import org.tizen.emulator.skin.comm.sock.data.DisplayStateData;
 import org.tizen.emulator.skin.comm.sock.data.KeyEventData;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
@@ -183,8 +184,6 @@ public class PhoneShapeSkinComposer implements ISkinComposer {
                logger.info("lcd bounds : " + lcdBounds);
 
                currentState.setDisplayBounds(lcdBounds);
-               currentState.setUpdateDisplayBounds(true);
-               //lcdCanvas.setBounds(lcdBounds);
 
                /* arrange the skin image */
                Image tempImage = null;
@@ -232,6 +231,7 @@ public class PhoneShapeSkinComposer implements ISkinComposer {
                /* custom window shape */
                SkinUtil.trimShell(shell, currentState.getCurrentImage());
 
+               currentState.setNeedToUpdateDisplay(true);
                shell.redraw();
        }
 
@@ -271,9 +271,15 @@ public class PhoneShapeSkinComposer implements ISkinComposer {
                shellPaintListener = new PaintListener() {
                        @Override
                        public void paintControl(final PaintEvent e) {
-                               if (currentState.isUpdateDisplayBounds() == true) {
-                                       currentState.setUpdateDisplayBounds(false);
+                               if (currentState.isNeedToUpdateDisplay() == true) {
+                                       currentState.setNeedToUpdateDisplay(false);
                                        lcdCanvas.setBounds(currentState.getDisplayBounds());
+
+                                       /* Let's do one more update for sdl display surface
+                                       while skipping of framebuffer drawing */
+                                       DisplayStateData lcdStateData = new DisplayStateData(
+                                                       currentState.getCurrentScale(), currentState.getCurrentRotationId());
+                                       skin.communicator.sendToQEMU(SendCommand.CHANGE_LCD_STATE, lcdStateData);
                                }
 
                                /* general shell does not support native transparency,