aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriff Hazen <griff@google.com>2015-07-22 17:22:24 -0700
committerGriff Hazen <griff@google.com>2015-07-22 17:28:38 -0700
commit86e5e6acb1e8f2dee89a8c7927750cb0f955e109 (patch)
treeb548ffba69ce5fb7d18ac9b086a6762a2fca7924
parentccc67f3f00dd92210b64c610abbb93bb557ac526 (diff)
downloadqemu-86e5e6acb1e8f2dee89a8c7927750cb0f955e109.tar.gz
Add emulator support for 280 and 360 dpi
280 was added in API 22 360 was added in API 23 Bug: 19966825 Bug: 19528291 Change-Id: I970fb769eab92612667e82135ec4596be3e0f305
-rw-r--r--android/hw-lcd.c11
-rw-r--r--android/hw-lcd.h3
2 files changed, 9 insertions, 5 deletions
diff --git a/android/hw-lcd.c b/android/hw-lcd.c
index 5b5d4e7be7..26c16eeaea 100644
--- a/android/hw-lcd.c
+++ b/android/hw-lcd.c
@@ -18,7 +18,7 @@ hwLcd_setBootProperty(int density)
{
char temp[8];
- /* Map density to one of our five bucket values.
+ /* Map density to one of our bucket values.
The TV density is a bit particular (and not actually a bucket
value) so we do only exact match on it.
*/
@@ -27,10 +27,14 @@ hwLcd_setBootProperty(int density)
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)
+ else if (density < (LCD_DENSITY_HDPI + LCD_DENSITY_280DPI)/2)
density = LCD_DENSITY_HDPI;
- else if (density < (LCD_DENSITY_XHDPI + LCD_DENSITY_400DPI)/2)
+ else if (density < (LCD_DENSITY_280DPI + LCD_DENSITY_XHDPI)/2)
+ density = LCD_DENSITY_280DPI;
+ else if (density < (LCD_DENSITY_XHDPI + LCD_DENSITY_360DPI)/2)
density = LCD_DENSITY_XHDPI;
+ else if (density < (LCD_DENSITY_360DPI + LCD_DENSITY_400DPI)/2)
+ density = LCD_DENSITY_360DPI;
else if (density < (LCD_DENSITY_400DPI + LCD_DENSITY_XXHDPI)/2)
density = LCD_DENSITY_400DPI;
else if (density < (LCD_DENSITY_XXHDPI + LCD_DENSITY_XXXHDPI)/2)
@@ -42,4 +46,3 @@ hwLcd_setBootProperty(int density)
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 b8abb5836f..24d1fe9408 100644
--- a/android/hw-lcd.h
+++ b/android/hw-lcd.h
@@ -16,7 +16,9 @@
#define LCD_DENSITY_MDPI 160
#define LCD_DENSITY_TVDPI 213
#define LCD_DENSITY_HDPI 240
+#define LCD_DENSITY_280DPI 280
#define LCD_DENSITY_XHDPI 320
+#define LCD_DENSITY_360DPI 360
#define LCD_DENSITY_400DPI 400
#define LCD_DENSITY_XXHDPI 480
#define LCD_DENSITY_XXXHDPI 640
@@ -25,4 +27,3 @@
extern void hwLcd_setBootProperty(int density);
#endif /* _ANDROID_HW_LCD_H */
-