diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-09-23 14:09:34 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-09-23 14:26:02 -0700 |
| commit | de0dfb7b65a02d4dd74c271b558adee0973fc267 (patch) | |
| tree | c2e701a78f831978378ff3a9c219209aae3e4fc2 /graphics | |
| parent | 5dd7c726f45fd7b7ab473471dc504c00012a6856 (diff) | |
| download | frameworks_base-de0dfb7b65a02d4dd74c271b558adee0973fc267.zip frameworks_base-de0dfb7b65a02d4dd74c271b558adee0973fc267.tar.gz frameworks_base-de0dfb7b65a02d4dd74c271b558adee0973fc267.tar.bz2 | |
Fix issue #2125720 Weather Forecast Widget - graphics do not scale
I forgot to add the new density field to the Bitmaps' parcelable data.
Change-Id: I77cf3e93e356297e0caed6fc71b62b5cd8f79124
Diffstat (limited to 'graphics')
| -rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index eef1096..216dea0 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -77,7 +77,8 @@ public final class Bitmap implements Parcelable { This can be called from JNI code. */ - private Bitmap(int nativeBitmap, boolean isMutable, byte[] ninePatchChunk) { + private Bitmap(int nativeBitmap, boolean isMutable, byte[] ninePatchChunk, + int density) { if (nativeBitmap == 0) { throw new RuntimeException("internal error: native bitmap is 0"); } @@ -86,6 +87,9 @@ public final class Bitmap implements Parcelable { mNativeBitmap = nativeBitmap; mIsMutable = isMutable; mNinePatchChunk = ninePatchChunk; + if (density >= 0) { + mDensity = density; + } } /** @@ -892,7 +896,7 @@ public final class Bitmap implements Parcelable { */ public void writeToParcel(Parcel p, int flags) { checkRecycled("Can't parcel a recycled bitmap"); - if (!nativeWriteToParcel(mNativeBitmap, mIsMutable, p)) { + if (!nativeWriteToParcel(mNativeBitmap, mIsMutable, mDensity, p)) { throw new RuntimeException("native writeToParcel failed"); } } @@ -1006,6 +1010,7 @@ public final class Bitmap implements Parcelable { // returns true on success private static native boolean nativeWriteToParcel(int nativeBitmap, boolean isMutable, + int density, Parcel p); // returns a new bitmap built from the native bitmap's alpha, and the paint private static native Bitmap nativeExtractAlpha(int nativeBitmap, |
