diff options
author | Dianne Hackborn <hackbod@google.com> | 2009-07-29 15:41:19 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2009-07-29 19:44:01 -0700 |
commit | 0d221012ff5fd314711c00ed30e9b807b9c454c1 (patch) | |
tree | 328d42900c9765e3bde9ad98a936a9122c679e5e /core/java/android/view | |
parent | c6eb5ac988518f41938c4f021003d6c202d84819 (diff) | |
download | frameworks_base-0d221012ff5fd314711c00ed30e9b807b9c454c1.zip frameworks_base-0d221012ff5fd314711c00ed30e9b807b9c454c1.tar.gz frameworks_base-0d221012ff5fd314711c00ed30e9b807b9c454c1.tar.bz2 |
Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
It turns out we were not returning the density for anything retrieved from a
TypedArray... which basically means any bitmap references from a layout or style...!!!
This is now fixed.
Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/ViewRoot.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/core/java/android/view/ViewRoot.java b/core/java/android/view/ViewRoot.java index b6119aa..f7cb06b 100644 --- a/core/java/android/view/ViewRoot.java +++ b/core/java/android/view/ViewRoot.java @@ -21,7 +21,6 @@ import com.android.internal.view.IInputMethodSession; import android.graphics.Canvas; import android.graphics.PixelFormat; -import android.graphics.Point; import android.graphics.PorterDuff; import android.graphics.Rect; import android.graphics.Region; @@ -1213,6 +1212,8 @@ public final class ViewRoot extends Handler implements ViewParent, if (mTranslator != null) { mTranslator.translateCanvas(canvas); } + canvas.setScreenDensity(scalingRequired + ? DisplayMetrics.DENSITY_DEVICE : 0); mView.draw(canvas); if (Config.DEBUG && ViewDebug.consistencyCheckEnabled) { mView.dispatchConsistencyCheck(ViewDebug.CONSISTENCY_DRAWING); @@ -1321,6 +1322,8 @@ public final class ViewRoot extends Handler implements ViewParent, if (mTranslator != null) { mTranslator.translateCanvas(canvas); } + canvas.setScreenDensity(scalingRequired + ? DisplayMetrics.DENSITY_DEVICE : 0); mView.draw(canvas); } finally { mAttachInfo.mIgnoreDirtyState = false; |