OSDN Git Service

Reset the mDpiX and mDpiY values when qemu.sf.lcd_density is defined.
authorDavid 'Digit' Turner <digit@google.com>
Tue, 28 Jul 2009 22:38:58 +0000 (00:38 +0200)
committerDavid 'Digit' Turner <digit@google.com>
Tue, 28 Jul 2009 22:38:58 +0000 (00:38 +0200)
This will make android.view.Display return corresponding values for
the screen's DPI.

libs/surfaceflinger/DisplayHardware/DisplayHardware.cpp

index eec645e..ab02fa0 100644 (file)
@@ -197,6 +197,9 @@ void DisplayHardware::init(uint32_t dpy)
             LOGW("ro.sf.lcd_density not defined, using 160 dpi by default.");
             strcpy(property, "160");
         }
+    } else {
+        /* for the emulator case, reset the dpi values too */
+        mDpiX = mDpiY = atoi(property);
     }
     mDensity = atoi(property) * (1.0f/160.0f);