am 6ff211e0: am 8f6c5226: am 55a9be3d: Merge "Fix for bug 3434228" into honeycomb-mr1

* commit '6ff211e08a7c5d51e3899d10be53878c05c244b5':
  Fix for bug 3434228
diff --git a/RenderScript.h b/RenderScript.h
index bb5e4aa..ffa9a8c 100644
--- a/RenderScript.h
+++ b/RenderScript.h
@@ -76,7 +76,8 @@
 void rsDeviceSetConfig(RsDevice, RsDeviceParam, int32_t value);
 
 RsContext rsContextCreate(RsDevice, uint32_t version);
-RsContext rsContextCreateGL(RsDevice, uint32_t version, RsSurfaceConfig sc);
+RsContext rsContextCreateGL(RsDevice, uint32_t version,
+                            RsSurfaceConfig sc, uint32_t dpi);
 void rsContextDestroy(RsContext);
 
 enum RsMessageToClientType {
diff --git a/rsContext.cpp b/rsContext.cpp
index f9e29f1..c63d183 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -630,6 +630,7 @@
     mPaused = false;
     mObjHead = NULL;
     mError = RS_ERROR_NONE;
+    mDPI = 96;
 }
 
 Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) {
@@ -1078,10 +1079,12 @@
     return rsc;
 }
 
-RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, RsSurfaceConfig sc) {
+RsContext rsContextCreateGL(RsDevice vdev, uint32_t version,
+                            RsSurfaceConfig sc, uint32_t dpi) {
     LOGV("rsContextCreateGL %p", vdev);
     Device * dev = static_cast<Device *>(vdev);
     Context *rsc = Context::createContext(dev, &sc);
+    rsc->setDPI(dpi);
     LOGV("rsContextCreateGL ret %p ", rsc);
     return rsc;
 }
diff --git a/rsContext.h b/rsContext.h
index c5e32a6..50f63df 100644
--- a/rsContext.h
+++ b/rsContext.h
@@ -218,6 +218,8 @@
 
     void launchThreads(WorkerCallback_t cbk, void *data);
     uint32_t getWorkerPoolSize() const {return (uint32_t)mWorkers.mCount;}
+    uint32_t getDPI() const {return mDPI;}
+    void setDPI(uint32_t dpi) {mDPI = dpi;}
 
 protected:
     Device *mDev;
@@ -258,6 +260,7 @@
         float EXT_texture_max_aniso;
     } mGL;
 
+    uint32_t mDPI;
     uint32_t mWidth;
     uint32_t mHeight;
     int32_t mThreadPriority;
diff --git a/rsFont.cpp b/rsFont.cpp
index 1c1bc98..01dbab8 100644
--- a/rsFont.cpp
+++ b/rsFont.cpp
@@ -733,7 +733,7 @@
             String8 fullPath(getenv("ANDROID_ROOT"));
             fullPath += fontsDir;
 
-            mDefault.set(Font::create(mRSC, fullPath.string(), 16, 96));
+            mDefault.set(Font::create(mRSC, fullPath.string(), 8, mRSC->getDPI()));
         }
         currentFont = mDefault.get();
     }