From: GiWoong Kim Date: Thu, 19 Dec 2013 09:20:51 +0000 (+0900) Subject: skin: modified skin region setting X-Git-Tag: TizenStudio_2.0_p2.3~419^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01b0c8bac5b25e5db6cd8799bf361987a7420d7e;p=sdk%2Femulator%2Fqemu.git skin: modified skin region setting SWT library has a problem for stretch image on Ubuntu. So, to avoid a this issue, I applied the different way(with no side effects) to create a General skin image. Change-Id: I05edbd22f43691002c9fd79403ec5e1515e6d7b1 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java index 1f8f970..ec26582 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java @@ -244,7 +244,9 @@ public class GeneralPurposeSkinComposer implements ISkinComposer { frameMaker.getPatchedImage(displayBounds.width, displayBounds.height); /* make window region */ - Region region = getTrimmingRegion(shell.getDisplay(), generalSkin); + Region region = (SwtUtil.isLinuxPlatform() == false) ? + getTrimmingRegion(shell.getDisplay(), generalSkin) : /* color key */ + SkinUtil.getTrimmingRegion(generalSkin); /* update the skin state information */ currentState.setCurrentScale(scale); diff --git a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java index 7d44500..8fa006c 100644 --- a/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java +++ b/tizen/src/skin/client/src/org/tizen/emulator/skin/layout/SkinPatches.java @@ -34,6 +34,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.ImageData; +import org.eclipse.swt.graphics.PaletteData; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; import org.tizen.emulator.skin.log.SkinLogger; @@ -97,29 +99,19 @@ public class SkinPatches { int patchedImageWidth = (patchWidth * 2) + centerPatchWidth; int patchedImageHeight = (patchHeight * 2) + centerPatchHeight; - Image patchedImage = new Image(display, - patchedImageWidth, patchedImageHeight); + ImageData imageData = new ImageData( + patchedImageWidth, patchedImageHeight, 32, + new PaletteData(0xFF000000, 0x00FF0000, 0x0000FF00)); + imageData.transparentPixel = 0; + Image patchedImage = new Image(display, imageData); GC gc = new GC(patchedImage); - if (SwtUtil.isLinuxPlatform() == true) { - /* - * Bug in Cairo. When drawing the image stretched with an interpolation - * algorithm, the edges of the image are faded. This is not a bug, but - * it is not desired. To avoid the faded edges, it should be possible to - * use cairo_pattern_set_extend() to set the pattern extend to either - * CAIRO_EXTEND_REFLECT or CAIRO_EXTEND_PAD, but these are not implemented - * in some versions of cairo (1.2.x) and have bugs in others (in 1.4.2 it - * draws with black edges). The fix is to implement CAIRO_EXTEND_REFLECT - * by creating an image that is 3 times bigger than the original, drawing - * the original image in every quadrant (with an appropriate transform) and - * use this image as the pattern. - */ - gc.setInterpolation(SWT.NONE); + if (SwtUtil.isLinuxPlatform() == false) { + /* SWT works differently. So, we need a color key */ + gc.setBackground(display.getSystemColor(SWT.COLOR_MAGENTA)); + gc.fillRectangle(0, 0, patchedImageWidth, patchedImageHeight); } - gc.setBackground(display.getSystemColor(SWT.COLOR_MAGENTA)); - gc.fillRectangle(0, 0, patchedImageWidth, patchedImageHeight); - /* top side */ // TODO: copy alphaData gc.drawImage(imageLT, 0, 0);