summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-06-15 18:06:47 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-06-15 18:06:47 -0700
commitd4824c256cc510cedb8d50e84767d1122886b547 (patch)
treee6c86fe5768f24630e9a8fa6dd6ea18b8772829c /graphics/java/android
parentcb8e982754c1532feaa835e443a1d4aa9dff9e2d (diff)
parent0bbae0836426ba2704e38e7f90a9d0ca502ab71d (diff)
downloadframeworks_base-d4824c256cc510cedb8d50e84767d1122886b547.zip
frameworks_base-d4824c256cc510cedb8d50e84767d1122886b547.tar.gz
frameworks_base-d4824c256cc510cedb8d50e84767d1122886b547.tar.bz2
Merge "Add new API to check whether a Bitmap was modified."
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/Bitmap.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index 7ca3741..e261cfa 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -172,6 +172,19 @@ public final class Bitmap implements Parcelable {
}
/**
+ * Returns the generation ID of this bitmap. The generation ID changes
+ * whenever the bitmap is modified. This can be used as an efficient way to
+ * check if a bitmap has changed.
+ *
+ * @return The current generation ID for this bitmap.
+ *
+ * @hide
+ */
+ public int getGenerationId() {
+ return nativeGenerationId(mNativeBitmap);
+ }
+
+ /**
* This is called by methods that want to throw an exception if the bitmap
* has already been recycled.
*/
@@ -1041,6 +1054,7 @@ public final class Bitmap implements Parcelable {
private static native void nativeCopyPixelsToBuffer(int nativeBitmap,
Buffer dst);
private static native void nativeCopyPixelsFromBuffer(int nb, Buffer src);
+ private static native int nativeGenerationId(int nativeBitmap);
private static native Bitmap nativeCreateFromParcel(Parcel p);
// returns true on success