diff options
author | Romain Guy <romainguy@google.com> | 2012-01-19 16:53:41 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2012-01-19 17:16:38 -0800 |
commit | f9d9c065ed75f1196316a9a31f92309f602cef76 (patch) | |
tree | ca552893d80825f16728e613d2aa341b1cdd92d9 /graphics/java/android/graphics/Picture.java | |
parent | 75582e889d4895483309e38364266073be6d46b8 (diff) | |
download | frameworks_base-f9d9c065ed75f1196316a9a31f92309f602cef76.zip frameworks_base-f9d9c065ed75f1196316a9a31f92309f602cef76.tar.gz frameworks_base-f9d9c065ed75f1196316a9a31f92309f602cef76.tar.bz2 |
Deprecate unused APIs
Change-Id: I0107e246b632dda96b8b025217936954f1f46283
Diffstat (limited to 'graphics/java/android/graphics/Picture.java')
-rw-r--r-- | graphics/java/android/graphics/Picture.java | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java index 9c06fed..997141d 100644 --- a/graphics/java/android/graphics/Picture.java +++ b/graphics/java/android/graphics/Picture.java @@ -32,10 +32,15 @@ public class Picture { private Canvas mRecordingCanvas; private final int mNativePicture; + /** + * @hide + */ + public final boolean createdFromStream; + private static final int WORKING_STREAM_STORAGE = 16 * 1024; public Picture() { - this(nativeConstructor(0)); + this(nativeConstructor(0), false); } /** @@ -44,7 +49,7 @@ public class Picture { * changes will not be reflected in this picture. */ public Picture(Picture src) { - this(nativeConstructor(src != null ? src.mNativePicture : 0)); + this(nativeConstructor(src != null ? src.mNativePicture : 0), false); } /** @@ -101,15 +106,24 @@ public class Picture { /** * Create a new picture (already recorded) from the data in the stream. This * data was generated by a previous call to writeToStream(). + * + * <strong>Note:</strong> a picture created from an input stream cannot be + * replayed on a hardware accelerated canvas. + * + * @see #writeToStream(java.io.OutputStream) */ public static Picture createFromStream(InputStream stream) { - return new Picture( - nativeCreateFromStream(stream, new byte[WORKING_STREAM_STORAGE])); + return new Picture(nativeCreateFromStream(stream, new byte[WORKING_STREAM_STORAGE]), true); } /** * Write the picture contents to a stream. The data can be used to recreate * the picture in this or another process by calling createFromStream. + * + * <strong>Note:</strong> a picture created from an input stream cannot be + * replayed on a hardware accelerated canvas. + * + * @see #createFromStream(java.io.InputStream) */ public void writeToStream(OutputStream stream) { // do explicit check before calling the native method @@ -129,16 +143,17 @@ public class Picture { super.finalize(); } } - - /*package*/ final int ni() { + + final int ni() { return mNativePicture; } - private Picture(int nativePicture) { + private Picture(int nativePicture, boolean fromStream) { if (nativePicture == 0) { throw new RuntimeException(); } mNativePicture = nativePicture; + createdFromStream = fromStream; } // return empty picture if src is 0, or a copy of the native src |