| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkPicture_DEFINED | 8 #ifndef SkPicture_DEFINED |
| 9 #define SkPicture_DEFINED | 9 #define SkPicture_DEFINED |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 typedef bool (*InstallPixelRefProc)(const void* src, size_t length, SkBitmap
* dst); | 47 typedef bool (*InstallPixelRefProc)(const void* src, size_t length, SkBitmap
* dst); |
| 48 | 48 |
| 49 /** | 49 /** |
| 50 * Recreate a picture that was serialized into a stream. | 50 * Recreate a picture that was serialized into a stream. |
| 51 * @param SkStream Serialized picture data. Ownership is unchanged by this
call. | 51 * @param SkStream Serialized picture data. Ownership is unchanged by this
call. |
| 52 * @param proc Function pointer for installing pixelrefs on SkBitmaps repre
senting the | 52 * @param proc Function pointer for installing pixelrefs on SkBitmaps repre
senting the |
| 53 * encoded bitmap data from the stream. | 53 * encoded bitmap data from the stream. |
| 54 * @return A new SkPicture representing the serialized data, or NULL if the
stream is | 54 * @return A new SkPicture representing the serialized data, or NULL if the
stream is |
| 55 * invalid. | 55 * invalid. |
| 56 */ | 56 */ |
| 57 static SkPicture* CreateFromStream(SkStream*, InstallPixelRefProc proc); | 57 static SkPicture* CreateFromStream(SkStream*, |
| 58 | 58 InstallPixelRefProc proc = &SkImageDecode
r::DecodeMemory); |
| 59 /** | |
| 60 * Recreate a picture that was serialized into a stream. | |
| 61 * | |
| 62 * Any serialized images in the stream will be passed to | |
| 63 * SkImageGenerator::NewFromEncoded. | |
| 64 * | |
| 65 * @param SkStream Serialized picture data. Ownership is unchanged by this
call. | |
| 66 * @return A new SkPicture representing the serialized data, or NULL if the
stream is | |
| 67 * invalid. | |
| 68 */ | |
| 69 static SkPicture* CreateFromStream(SkStream*); | |
| 70 | 59 |
| 71 /** | 60 /** |
| 72 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap | 61 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap |
| 73 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng | 62 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng |
| 74 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). | 63 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). |
| 75 * @param SkReadBuffer Serialized picture data. | 64 * @param SkReadBuffer Serialized picture data. |
| 76 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is | 65 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is |
| 77 * invalid. | 66 * invalid. |
| 78 */ | 67 */ |
| 79 static SkPicture* CreateFromBuffer(SkReadBuffer&); | 68 static SkPicture* CreateFromBuffer(SkReadBuffer&); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 static bool IsValidPictInfo(const SkPictInfo& info); | 198 static bool IsValidPictInfo(const SkPictInfo& info); |
| 210 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 199 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
| 211 | 200 |
| 212 SkPictInfo createHeader() const; | 201 SkPictInfo createHeader() const; |
| 213 SkPictureData* backport() const; | 202 SkPictureData* backport() const; |
| 214 | 203 |
| 215 mutable uint32_t fUniqueID; | 204 mutable uint32_t fUniqueID; |
| 216 }; | 205 }; |
| 217 | 206 |
| 218 #endif | 207 #endif |
| OLD | NEW |