/**@class android.graphics.Picture @extends java.lang.Object A Picture records drawing calls (via the canvas returned by beginRecording) and can then play them back into Canvas (via {@link android.graphics.Picture#draw(Canvas)} or {@link android.graphics.Canvas#drawPicture(Picture)}).For most content (e.g. text, lines, rectangles), drawing a sequence from a picture can be faster than the equivalent API calls, since the picture performs its playback without incurring any method-call overhead. <p class="note"><strong>Note:</strong> Prior to API level 23 a picture cannot be replayed on a hardware accelerated canvas.</p> */ var Picture = { /**Immediately releases the backing data of the Picture. This object will no longer be usable after calling this, and any further calls on the Picture will throw an IllegalStateException. // TODO: Support? @hide */ close : function( ) {}, /**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 commands (e.g. {@link android.graphics.Canvas#drawRect(Rect, Paint)}) will be recorded. To stop recording, call endRecording(). After endRecording() the Canvas that was returned must no longer be used, and nothing should be drawn into it. */ beginRecording : function( ) {}, /**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 be used anymore. This is automatically called if {@link android.graphics.Picture#draw} or {@link android.graphics.Canvas#drawPicture(Picture)} is called. */ endRecording : function( ) {}, /**Get the width of the picture as passed to beginRecording. This does not reflect (per se) the content of the picture. */ getWidth : function( ) {}, /**Get the height of the picture as passed to beginRecording. This does not reflect (per se) the content of the picture. */ getHeight : function( ) {}, /**Indicates whether or not this Picture contains recorded commands that only work when drawn to a hardware-accelerated canvas. If this returns true then this Picture can only be drawn to another Picture or to a Canvas where canvas.isHardwareAccelerated() is true. Note this value is only updated after recording has finished by a call to {@link #endRecording}(). Prior to that it will be the default value of false. @return {Boolean} true if the Picture can only be drawn to a hardware-accelerated canvas, false otherwise. */ requiresHardwareAcceleration : function( ) {}, /**Draw this picture on the canvas. <p> Prior to {@link android.os.Build.VERSION_CODES#LOLLIPOP}, 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 android.graphics.Picture#endRecording()} in order to prepare for playback. @param {Object {Canvas}} canvas The picture is drawn to this canvas */ draw : function( ) {}, /**Create a new picture (already recorded) from the data in the stream. This data was generated by a previous call to writeToStream(). Pictures that have been persisted across device restarts are not guaranteed to decode properly and are highly discouraged. @see #writeToStream(java.io.OutputStream) @removed @deprecated The recommended alternative is to not use writeToStream and instead draw the picture into a Bitmap from which you can persist it as raw or compressed pixels. */ createFromStream : function( ) {}, /**Write the picture contents to a stream. The data can be used to recreate the picture in this or another process by calling createFromStream(...) The resulting stream is NOT to be persisted across device restarts as there is no guarantee that the Picture can be successfully reconstructed. @see #createFromStream(java.io.InputStream) @removed @deprecated The recommended alternative is to draw the picture into a Bitmap from which you can persist it as raw or compressed pixels. */ writeToStream : function( ) {}, };