From: Minkee Lee Date: Tue, 2 Feb 2016 04:55:52 +0000 (+0900) Subject: option: fix direct-rendering option X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06795e4fe6452a6b16a32f130179e524b2576b9f;p=sdk%2Femulator%2Femulator-manager.git option: fix direct-rendering option 1. Do nothing if version is under 2.3.2. 2. If a user cannot select an option in UI, option is regarded as true. (Default is qt-enable) Change-Id: I9c2d229851278611e7cfde680304e9716b98f7e1 Signed-off-by: Minkee Lee --- diff --git a/src/org/tizen/emulator/manager/platform/BaseImage.java b/src/org/tizen/emulator/manager/platform/BaseImage.java index a5173ed..95f9649 100644 --- a/src/org/tizen/emulator/manager/platform/BaseImage.java +++ b/src/org/tizen/emulator/manager/platform/BaseImage.java @@ -575,6 +575,15 @@ public class BaseImage { } + public boolean isItemExist(String name) { + for (VMItem item : getVmItemList()) { + if (item.getName().equals(name)) { + return true; + } + } + return false; + } + @Override public boolean equals(Object obj) { if (!(obj instanceof BaseImage)) { diff --git a/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java b/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java index c49b951..28003f8 100644 --- a/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java +++ b/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java @@ -43,21 +43,29 @@ public class DisplayModeOption extends Option { public void getLaunchArgument(LaunchConfig config, VMProperty property) throws VMWorkerException { + if (islesserThan(property.getImageVersion(), "2.3.2")) { + return; + } + boolean useDirectRendering; - if (checkOnOrEmpty(property.getPropertyValue().getAdvancedOptionSubValue( - "displayMode", "qtEnable"))) { //$NON-NLS-1$ //$NON-NLS-2$ - useDirectRendering = true; + if (property.getPropertyValue().baseImage.isItemExist("displayMode")) { + if (checkOnOrEmpty(property.getPropertyValue().getAdvancedOptionSubValue( + "displayMode", "qtEnable"))) { //$NON-NLS-1$ //$NON-NLS-2$ + useDirectRendering = true; + + } else { + useDirectRendering = false; + } } else { - useDirectRendering = false; + // if a user cannot control option in UI, set true (default) + useDirectRendering = true; } if (useDirectRendering) { - if (isGreaterThanOrEqualTo(property.getImageVersion(), "2.3.2")) { - if (RemoteOption.isRemoteMode(property)) { - return; - } + if (RemoteOption.isRemoteMode(property)) { + return; } String rendering = null; @@ -74,10 +82,6 @@ public class DisplayModeOption extends Option { + ",dpi=" + varForm(OPTION_KEY.VAR_DISPLAY_PIXEL_DENSITY)); } else { - if (islesserThan(property.getImageVersion(), "2.3.2")) { - // No option is required for java skin under version 2.3.2. - return; - } if (EmulatorManager.isMac()) { config.addQemuOption(DISPLAY, MARU_SHM);