aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Turner <digit@android.com>2011-05-17 12:25:30 -0700
committerAndroid Code Review <code-review@android.com>2011-05-17 12:25:30 -0700
commit1378630ee468a0aff2d0985c5b59291c3df80615 (patch)
treed1e8dcb4bd4ce3e9ce67484f13eef5945acb0881
parent2c013bfdc4f39492fd14f24c155252daaa5fdfde (diff)
parentcdca5efd64ac52af0d780b38976884cc3439223a (diff)
downloadexternal_qemu-1378630ee468a0aff2d0985c5b59291c3df80615.zip
external_qemu-1378630ee468a0aff2d0985c5b59291c3df80615.tar.gz
external_qemu-1378630ee468a0aff2d0985c5b59291c3df80615.tar.bz2
Merge "Add support for xhdpi when injecting a skin dpi into the emulator."
-rw-r--r--android/hw-lcd.c12
-rw-r--r--android/hw-lcd.h7
2 files changed, 11 insertions, 8 deletions
diff --git a/android/hw-lcd.c b/android/hw-lcd.c
index 2c06d69..f84f661 100644
--- a/android/hw-lcd.c
+++ b/android/hw-lcd.c
@@ -19,12 +19,14 @@ hwLcd_setBootProperty(int density)
char temp[8];
/* map density to one of our three values for now */
- if (density < (LCD_DENSITY_MIN + LCD_DENSITY_DEFAULT)/2)
- density = LCD_DENSITY_MIN;
- else if (density < (LCD_DENSITY_DEFAULT + LCD_DENSITY_MAX)/2)
- density = LCD_DENSITY_DEFAULT;
+ if (density < (LCD_DENSITY_LDPI + LCD_DENSITY_MDPI)/2)
+ density = LCD_DENSITY_LDPI;
+ else if (density < (LCD_DENSITY_MDPI + LCD_DENSITY_HDPI)/2)
+ density = LCD_DENSITY_MDPI;
+ else if (density < (LCD_DENSITY_HDPI + LCD_DENSITY_XHDPI)/2)
+ density = LCD_DENSITY_HDPI;
else
- density = LCD_DENSITY_MAX;
+ density = LCD_DENSITY_XHDPI;
snprintf(temp, sizeof temp, "%d", density);
boot_property_add("qemu.sf.lcd_density", temp);
diff --git a/android/hw-lcd.h b/android/hw-lcd.h
index b9fdb72..c902b13 100644
--- a/android/hw-lcd.h
+++ b/android/hw-lcd.h
@@ -12,9 +12,10 @@
#ifndef _ANDROID_HW_LCD_H
#define _ANDROID_HW_LCD_H
-#define LCD_DENSITY_MIN 120
-#define LCD_DENSITY_DEFAULT 160
-#define LCD_DENSITY_MAX 240
+#define LCD_DENSITY_LDPI 120
+#define LCD_DENSITY_MDPI 160
+#define LCD_DENSITY_HDPI 240
+#define LCD_DENSITY_XHDPI 320
/* Sets the boot property corresponding to the emulated abstract LCD density */
extern void hwLcd_setBootProperty(int density);