ScreenShot: get framebuffer from shared memory
authorgiwoong.kim <giwoong.kim@samsung.com>
Thu, 18 Oct 2012 12:36:32 +0000 (21:36 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Thu, 18 Oct 2012 12:39:32 +0000 (21:39 +0900)
Get a framebuffer from shared memory through JNI.

Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ScreenShotDialog.java
tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ShmScreenShotWindow.java

index 8a2533a5003327e5d2059b6e6b92435398bc41a4..de7f50afeec799bbfd9b8d35ade2dfb79d1a89f4 100644 (file)
@@ -96,6 +96,7 @@ public class ScreenShotDialog {
        private Logger logger = SkinLogger.getSkinLogger( ScreenShotDialog.class ).getLogger();
 
        protected PaletteData paletteData;
+       protected PaletteData paletteData2;
        protected Image image;
        protected Canvas imageCanvas;
        private Shell shell;
@@ -103,7 +104,7 @@ public class ScreenShotDialog {
        private Label label;
 
        protected SocketCommunicator communicator;
-       private EmulatorSkin emulatorSkin;
+       protected EmulatorSkin emulatorSkin;
        protected EmulatorConfig config;
 
        private RotationInfo currentRotation;
@@ -178,7 +179,8 @@ public class ScreenShotDialog {
                        }
                } );
 
-               paletteData = new PaletteData( RED_MASK, GREEN_MASK, BLUE_MASK );
+               paletteData = new PaletteData(RED_MASK, GREEN_MASK, BLUE_MASK);
+               paletteData2 = new PaletteData(0x00FF0000, 0x0000FF00, 0x000000FF);
 
                scrollComposite.setContent( imageCanvas );
 
index 49120984346e939434f2ce7108084a3da480c9d0..ce848b2c7858ffed16d6be65c8d8e1c0356b64e7 100644 (file)
@@ -28,8 +28,6 @@
 
 package org.tizen.emulator.skin.screenshot;
 
-import java.util.logging.Logger;
-
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.graphics.ImageData;
 import org.eclipse.swt.widgets.Display;
@@ -40,13 +38,8 @@ import org.tizen.emulator.skin.comm.sock.SocketCommunicator;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
 import org.tizen.emulator.skin.exception.ScreenShotException;
-import org.tizen.emulator.skin.log.SkinLogger;
 
 public class ShmScreenShotWindow extends ScreenShotDialog {
-       private Logger logger = SkinLogger.getSkinLogger(
-                       ShmScreenShotWindow.class).getLogger();
-       
-       private EmulatorShmSkin emulatorSkin;
 
        /**
         * @brief constructor
@@ -56,20 +49,17 @@ public class ShmScreenShotWindow extends ScreenShotDialog {
                        SocketCommunicator communicator, EmulatorShmSkin emulatorSkin,
                        EmulatorConfig config, Image icon) throws ScreenShotException {
                super(parent, communicator, emulatorSkin, config, icon);
-               
-               this.emulatorSkin = emulatorSkin;
        }
-       
+
        protected void capture() throws ScreenShotException {
                int width = config.getArgInt(ArgsConstants.RESOLUTION_WIDTH);
                int height = config.getArgInt(ArgsConstants.RESOLUTION_HEIGHT);
 
                int[] array = new int[width * height];
-               //TODO:
-               //int result = emulatorSkin.getPixels(array); //from shared memory
+               int result = ((EmulatorShmSkin)emulatorSkin).getPixels(array); //from shared memory
                //logger.info("getPixels navtive function returned " + result);
 
-               ImageData imageData = new ImageData(width, height, COLOR_DEPTH, paletteData);
+               ImageData imageData = new ImageData(width, height, COLOR_DEPTH, paletteData2);
                for (int i = 0; i < height; i++) {
                        imageData.setPixels(0, i, width, array, i * width);
                 }