qt-option: Fixed qt option.
authorminkee.lee <minkee.lee@samsung.com>
Fri, 17 Jul 2015 06:39:30 +0000 (15:39 +0900)
committerminkee.lee <minkee.lee@samsung.com>
Fri, 17 Jul 2015 06:50:24 +0000 (15:50 +0900)
- rendering value is fixed to 'offscreen' if GPU option is 'off'.

Change-Id: Ice5485b9614d39442b733795b2fcedb3e0c009e2
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
src/org/tizen/emulator/manager/vms/option/CommonOptionFactroy.java
src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java [new file with mode: 0644]

index 23258df..cb6cc43 100644 (file)
@@ -62,6 +62,7 @@ public abstract class CommonOptionFactroy implements IOptionFactory {
                        }
                        addDeviceOption(item, optionList);
                }
+
        }
 
        // Plugin developer can override this if needed
@@ -122,6 +123,9 @@ public abstract class CommonOptionFactroy implements IOptionFactory {
                                        list.add(Option.getInstance(FrontCameraOption.class));
                                }
                        }
+
+               } else if (name.equals(ItemName.DISPLAY_MODE)) {
+                       list.add(Option.getInstance(DisplayModeOption.class));
                }
        }
 
diff --git a/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java b/src/org/tizen/emulator/manager/vms/option/DisplayModeOption.java
new file mode 100644 (file)
index 0000000..82b35bc
--- /dev/null
@@ -0,0 +1,58 @@
+/* Emulator Manager
+ *
+ * Copyright (C) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact:
+ * Minkee Lee <minkee.lee@samsung.com>
+ * SeokYeon Hwang <syeon.hwang@samsung.com>
+ * Sangho Park <sangho1206.park@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.emulator.manager.vms.option;
+
+import org.tizen.emulator.manager.EmulatorManager;
+import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.helper.VMWorkerException;
+
+public class DisplayModeOption extends Option {
+
+       @Override
+       public void getLaunchArgument(LaunchConfig config, VMProperty property)
+                       throws VMWorkerException {
+
+               if (checkOn(property.getPropertyValue().getAdvancedOptionSubValue(
+                               "displayMode", "qtEnable"))) {
+
+                       String rendering = null;
+                       if (!EmulatorManager.isMac()
+                                       && property.getConfiguration().getUsability().isHwGLAcceleration()) {
+                               rendering = "onscreen";
+
+                       } else {
+                               rendering = "offscreen";
+                       }
+                       config.addQemuOption("-display", "maru_qt,rendering=" + rendering);
+               }
+
+       }
+
+}