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
This commit is contained in:
Dianne Hackborn
2009-09-23 14:09:34 -07:00
parent 5dd7c726f4
commit de0dfb7b65
6 changed files with 21 additions and 13 deletions

View File

@@ -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,