From: GiWoong Kim Date: Tue, 19 Nov 2013 05:24:09 +0000 (+0900) Subject: skin: no need to set SWT interpolation on Windows/MacOS X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~589^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=100e0729497e4e4b2fe7b069735beb3ded3b5197;p=sdk%2Femulator%2Fqemu.git skin: no need to set SWT interpolation on Windows/MacOS On Ubuntu, when drawing the skin image stretched with an interpolation algorithm, the edges of the image are faded. This problem is not occured at Windows or MacOS. Change-Id: I4b38ab3cf53c30ff41a039e878b326ef557aafe6 Signed-off-by: GiWoong Kim --- 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 85876803d3..7d44500c07 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 @@ -37,6 +37,7 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Display; import org.tizen.emulator.skin.log.SkinLogger; +import org.tizen.emulator.skin.util.SwtUtil; public class SkinPatches { private Logger logger = @@ -99,14 +100,28 @@ public class SkinPatches { Image patchedImage = new Image(display, patchedImageWidth, patchedImageHeight); - // TODO: copy alphaData GC gc = new GC(patchedImage); - gc.setInterpolation(SWT.NONE); + 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); + } gc.setBackground(display.getSystemColor(SWT.COLOR_MAGENTA)); gc.fillRectangle(0, 0, patchedImageWidth, patchedImageHeight); /* top side */ + // TODO: copy alphaData gc.drawImage(imageLT, 0, 0); gc.drawImage(imageT, 0, 0, imageT.getImageData().width, imageT.getImageData().height, patchWidth, 0, centerPatchWidth, patchHeight);