screenshot: added masking 57/35257/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Sat, 27 Dec 2014 06:16:58 +0000 (15:16 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 13 Feb 2015 05:42:02 +0000 (21:42 -0800)
Change-Id: I2f28d25148c589be0b1858226fd2f4eae25685ba
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/SdlScreenShotWindow.java
tizen/src/skin/client/src/org/tizen/emulator/skin/screenshot/ShmScreenShotWindow.java

index 921bee6..603017f 100644 (file)
@@ -353,7 +353,12 @@ public class ScreenShotDialog {
        }
 
        private void clickShutter() throws ScreenShotException {
-               capture();
+               Image maskImage = skin.getDisplayCanvas().getMaskImage();
+               if (maskImage != null) {
+                       capture(SkinUtil.getMaskDataForImage(shell.getDisplay(), maskImage));
+               } else {
+                       capture(null);
+               }
 
                shell.getDisplay().asyncExec(new Runnable() {
                        @Override
@@ -363,7 +368,7 @@ public class ScreenShotDialog {
                });
        }
 
-       protected void capture() throws ScreenShotException {
+       protected void capture(ImageData maskData) throws ScreenShotException {
                /* abstract */
        }
 
index e05fda7..f3cdef7 100644 (file)
@@ -58,7 +58,8 @@ public class SdlScreenShotWindow extends ScreenShotDialog {
                this.palette = palette;
        }
 
-       protected void capture() throws ScreenShotException {
+       @Override
+       protected void capture(ImageData maskData) throws ScreenShotException {
                logger.info("screenshot capture");
 
                DataTranfer dataTranfer = skin.communicator.sendDataToQEMU(
@@ -75,7 +76,11 @@ public class SdlScreenShotWindow extends ScreenShotDialog {
                        imageData = getRotateImageData(imageData);
 
                        Image tempImage = imageShot;
-                       imageShot = new Image(Display.getDefault(), imageData);
+                       if (maskData != null) {
+                               imageShot = new Image(Display.getDefault(), imageData, maskData);
+                       } else {
+                               imageShot = new Image(Display.getDefault(), imageData);
+                       }
 
                        if (tempImage != null) {
                                tempImage.dispose();
index d08bc2e..27fc590 100644 (file)
@@ -56,7 +56,8 @@ public class ShmScreenShotWindow extends ScreenShotDialog {
                this.palette = palette;
        }
 
-       protected void capture() throws ScreenShotException {
+       @Override
+       protected void capture(ImageData maskData) throws ScreenShotException {
                logger.info("screenshot capture");
 
                int width = skin.getEmulatorSkinState().getCurrentResolutionWidth();
@@ -76,7 +77,11 @@ public class ShmScreenShotWindow extends ScreenShotDialog {
                imageData = getRotateImageData(imageData);
 
                Image tempImage = imageShot;
-               imageShot = new Image(Display.getDefault(), imageData);
+               if (maskData != null) {
+                       imageShot = new Image(Display.getDefault(), imageData, maskData);
+               } else {
+                       imageShot = new Image(Display.getDefault(), imageData);
+               }
 
                if (tempImage != null) {
                        tempImage.dispose();