diff options
| author | Robert Phillips <robertphillips@google.com> | 2014-06-12 16:12:34 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-10 21:32:31 +0000 |
| commit | 88b00784684d7b706c7b0c4e833b1d67d73358b9 (patch) | |
| tree | 7fc46c88959a73926424f0f3d2d3b71b726a1d41 /graphics/java/android/graphics/Picture.java | |
| parent | daf215cf95fe5464d67465d9a6540c6296ca90bd (diff) | |
| parent | dcc64a4e6b96d15b8b966dcb62f29a370e562271 (diff) | |
| download | frameworks_base-88b00784684d7b706c7b0c4e833b1d67d73358b9.zip frameworks_base-88b00784684d7b706c7b0c4e833b1d67d73358b9.tar.gz frameworks_base-88b00784684d7b706c7b0c4e833b1d67d73358b9.tar.bz2 | |
Merge "Update Picture documentation Enhanced comment"
Diffstat (limited to 'graphics/java/android/graphics/Picture.java')
| -rw-r--r-- | graphics/java/android/graphics/Picture.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/graphics/java/android/graphics/Picture.java b/graphics/java/android/graphics/Picture.java index de458af..a021165 100644 --- a/graphics/java/android/graphics/Picture.java +++ b/graphics/java/android/graphics/Picture.java @@ -53,7 +53,7 @@ public class Picture { public Picture(Picture src) { this(nativeConstructor(src != null ? src.mNativePicture : 0), false); } - + /** * To record a picture, call beginRecording() and then draw into the Canvas * that is returned. Nothing we appear on screen, but all of the draw @@ -67,7 +67,7 @@ public class Picture { mRecordingCanvas = new RecordingCanvas(this, ni); return mRecordingCanvas; } - + /** * Call endRecording when the picture is built. After this call, the picture * may be drawn, but the canvas that was returned by beginRecording must not @@ -92,16 +92,19 @@ public class Picture { * does not reflect (per se) the content of the picture. */ public native int getHeight(); - + /** - * Draw this picture on the canvas. The picture may have the side effect - * of changing the matrix and clip of the canvas. - * + * Draw this picture on the canvas. + * <p> + * Prior to {@link android.os.Build.VERSION_CODES#L}, this call could + * have the side effect of changing the matrix and clip of the canvas + * if this picture had imbalanced saves/restores. + * * <p> * <strong>Note:</strong> This forces the picture to internally call * {@link Picture#endRecording()} in order to prepare for playback. * - * @param canvas The picture is drawn to this canvas + * @param canvas The picture is drawn to this canvas */ public void draw(Canvas canvas) { if (mRecordingCanvas != null) { @@ -119,7 +122,7 @@ public class Picture { * <p> * <strong>Note:</strong> a picture created from an input stream cannot be * replayed on a hardware accelerated canvas. - * + * * @see #writeToStream(java.io.OutputStream) * @deprecated The recommended alternative is to not use writeToStream and * instead draw the picture into a Bitmap from which you can persist it as @@ -167,7 +170,7 @@ public class Picture { final long ni() { return mNativePicture; } - + private Picture(long nativePicture, boolean fromStream) { if (nativePicture == 0) { throw new RuntimeException(); @@ -187,7 +190,7 @@ public class Picture { private static native boolean nativeWriteToStream(long nativePicture, OutputStream stream, byte[] storage); private static native void nativeDestructor(long nativePicture); - + private static class RecordingCanvas extends Canvas { private final Picture mPicture; @@ -195,7 +198,7 @@ public class Picture { super(nativeCanvas); mPicture = pict; } - + @Override public void setBitmap(Bitmap bitmap) { throw new RuntimeException( |
