Commit 5b685e2f authored by yolandyan's avatar yolandyan Committed by Commit bot

Change gpu setting for emulator run with no ui

BUG=

Review URL: https://codereview.chromium.org/1645823002

Cr-Commit-Position: refs/heads/master@{#371988}
parent 5e83747b
...@@ -39,7 +39,7 @@ hw.cpu.arch={hw.cpu.arch} ...@@ -39,7 +39,7 @@ hw.cpu.arch={hw.cpu.arch}
hw.device.hash=-708107041 hw.device.hash=-708107041
hw.camera.back=none hw.camera.back=none
disk.dataPartition.size=800M disk.dataPartition.size=800M
hw.gpu.enabled=yes hw.gpu.enabled={gpu}
skin.path=720x1280 skin.path=720x1280
skin.dynamic=yes skin.dynamic=yes
hw.keyboard=yes hw.keyboard=yes
...@@ -331,6 +331,7 @@ class Emulator(object): ...@@ -331,6 +331,7 @@ class Emulator(object):
custom_config = custom_config.replace(key, replacements[key]) custom_config = custom_config.replace(key, replacements[key])
custom_config = custom_config.replace('{api.level}', str(api_level)) custom_config = custom_config.replace('{api.level}', str(api_level))
custom_config = custom_config.replace('{sdcard.size}', self.sdcard_size) custom_config = custom_config.replace('{sdcard.size}', self.sdcard_size)
custom_config.replace('{gpu}', 'no' if self.headless else 'yes')
with open(new_config_ini, 'w') as new_config_ini: with open(new_config_ini, 'w') as new_config_ini:
new_config_ini.write(custom_config) new_config_ini.write(custom_config)
...@@ -388,12 +389,14 @@ class Emulator(object): ...@@ -388,12 +389,14 @@ class Emulator(object):
'-no-audio', '-no-audio',
'-no-window' '-no-window'
]) ])
else:
emulator_command.extend([
'-gpu', 'on'
])
emulator_command.extend([ emulator_command.extend([
# Use a familiar name and port. # Use a familiar name and port.
'-avd', self.avd_name, '-avd', self.avd_name,
'-port', str(port), '-port', str(port),
# Enable GPU by default.
'-gpu', 'on',
# all the argument after qemu are sub arguments for qemu # all the argument after qemu are sub arguments for qemu
'-qemu', '-m', '1024', '-qemu', '-m', '1024',
]) ])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment