Loading core/jni/android/graphics/Bitmap.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ int Bitmap::getAshmemFd() const { } const SkImageInfo& Bitmap::info() const { assertValid(); return mPixelRef->info(); } Loading graphics/java/android/graphics/Bitmap.java +30 −6 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.Trace; import android.util.DisplayMetrics; import android.util.Log; import dalvik.system.VMRuntime; Loading @@ -33,6 +34,8 @@ import java.nio.IntBuffer; import java.nio.ShortBuffer; public final class Bitmap implements Parcelable { private static final String TAG = "Bitmap"; /** * Indicates that the bitmap was created for an unknown pixel density. * Loading Loading @@ -159,6 +162,9 @@ public final class Bitmap implements Parcelable { * @see #DENSITY_NONE */ public int getDensity() { if (mRecycled) { Log.w(TAG, "Called getDensity() on a recycle()'d bitmap! This is undefined behavior!"); } return mDensity; } Loading Loading @@ -330,7 +336,9 @@ public final class Bitmap implements Parcelable { * @return The current generation ID for this bitmap. */ public int getGenerationId() { if (mRecycled) return 0; if (mRecycled) { Log.w(TAG, "Called getGenerationId() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeGenerationId(mFinalizer.mNativeBitmap); } Loading Loading @@ -1057,7 +1065,9 @@ public final class Bitmap implements Parcelable { * @see BitmapFactory.Options#inPremultiplied */ public final boolean isPremultiplied() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called isPremultiplied() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeIsPremultiplied(mFinalizer.mNativeBitmap); } Loading Loading @@ -1089,11 +1099,17 @@ public final class Bitmap implements Parcelable { /** Returns the bitmap's width */ public final int getWidth() { if (mRecycled) { Log.w(TAG, "Called getWidth() on a recycle()'d bitmap! This is undefined behavior!"); } return mWidth; } /** Returns the bitmap's height */ public final int getHeight() { if (mRecycled) { Log.w(TAG, "Called getHeight() on a recycle()'d bitmap! This is undefined behavior!"); } return mHeight; } Loading Loading @@ -1176,7 +1192,9 @@ public final class Bitmap implements Parcelable { * @return number of bytes between rows of the native bitmap pixels. */ public final int getRowBytes() { if (mRecycled) return 0; if (mRecycled) { Log.w(TAG, "Called getRowBytes() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeRowBytes(mFinalizer.mNativeBitmap); } Loading Loading @@ -1220,7 +1238,9 @@ public final class Bitmap implements Parcelable { * that config, otherwise return null. */ public final Config getConfig() { if (mRecycled) return Config.ARGB_8888; if (mRecycled) { Log.w(TAG, "Called getConfig() on a recycle()'d bitmap! This is undefined behavior!"); } return Config.nativeToConfig(nativeConfig(mFinalizer.mNativeBitmap)); } Loading @@ -1233,7 +1253,9 @@ public final class Bitmap implements Parcelable { * it will return true by default. */ public final boolean hasAlpha() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called hasAlpha() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeHasAlpha(mFinalizer.mNativeBitmap); } Loading Loading @@ -1270,7 +1292,9 @@ public final class Bitmap implements Parcelable { * @see #setHasMipMap(boolean) */ public final boolean hasMipMap() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called hasMipMap() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeHasMipMap(mFinalizer.mNativeBitmap); } Loading Loading
core/jni/android/graphics/Bitmap.cpp +0 −1 Original line number Diff line number Diff line Loading @@ -218,7 +218,6 @@ int Bitmap::getAshmemFd() const { } const SkImageInfo& Bitmap::info() const { assertValid(); return mPixelRef->info(); } Loading
graphics/java/android/graphics/Bitmap.java +30 −6 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.Trace; import android.util.DisplayMetrics; import android.util.Log; import dalvik.system.VMRuntime; Loading @@ -33,6 +34,8 @@ import java.nio.IntBuffer; import java.nio.ShortBuffer; public final class Bitmap implements Parcelable { private static final String TAG = "Bitmap"; /** * Indicates that the bitmap was created for an unknown pixel density. * Loading Loading @@ -159,6 +162,9 @@ public final class Bitmap implements Parcelable { * @see #DENSITY_NONE */ public int getDensity() { if (mRecycled) { Log.w(TAG, "Called getDensity() on a recycle()'d bitmap! This is undefined behavior!"); } return mDensity; } Loading Loading @@ -330,7 +336,9 @@ public final class Bitmap implements Parcelable { * @return The current generation ID for this bitmap. */ public int getGenerationId() { if (mRecycled) return 0; if (mRecycled) { Log.w(TAG, "Called getGenerationId() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeGenerationId(mFinalizer.mNativeBitmap); } Loading Loading @@ -1057,7 +1065,9 @@ public final class Bitmap implements Parcelable { * @see BitmapFactory.Options#inPremultiplied */ public final boolean isPremultiplied() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called isPremultiplied() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeIsPremultiplied(mFinalizer.mNativeBitmap); } Loading Loading @@ -1089,11 +1099,17 @@ public final class Bitmap implements Parcelable { /** Returns the bitmap's width */ public final int getWidth() { if (mRecycled) { Log.w(TAG, "Called getWidth() on a recycle()'d bitmap! This is undefined behavior!"); } return mWidth; } /** Returns the bitmap's height */ public final int getHeight() { if (mRecycled) { Log.w(TAG, "Called getHeight() on a recycle()'d bitmap! This is undefined behavior!"); } return mHeight; } Loading Loading @@ -1176,7 +1192,9 @@ public final class Bitmap implements Parcelable { * @return number of bytes between rows of the native bitmap pixels. */ public final int getRowBytes() { if (mRecycled) return 0; if (mRecycled) { Log.w(TAG, "Called getRowBytes() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeRowBytes(mFinalizer.mNativeBitmap); } Loading Loading @@ -1220,7 +1238,9 @@ public final class Bitmap implements Parcelable { * that config, otherwise return null. */ public final Config getConfig() { if (mRecycled) return Config.ARGB_8888; if (mRecycled) { Log.w(TAG, "Called getConfig() on a recycle()'d bitmap! This is undefined behavior!"); } return Config.nativeToConfig(nativeConfig(mFinalizer.mNativeBitmap)); } Loading @@ -1233,7 +1253,9 @@ public final class Bitmap implements Parcelable { * it will return true by default. */ public final boolean hasAlpha() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called hasAlpha() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeHasAlpha(mFinalizer.mNativeBitmap); } Loading Loading @@ -1270,7 +1292,9 @@ public final class Bitmap implements Parcelable { * @see #setHasMipMap(boolean) */ public final boolean hasMipMap() { if (mRecycled) return false; if (mRecycled) { Log.w(TAG, "Called hasMipMap() on a recycle()'d bitmap! This is undefined behavior!"); } return nativeHasMipMap(mFinalizer.mNativeBitmap); } Loading