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*, | 57 static SkPicture* CreateFromStream(SkStream*, InstallPixelRefProc proc); |
58 InstallPixelRefProc proc = &SkImageDecode
r::DecodeMemory); | 58 |
| 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*); |
59 | 70 |
60 /** | 71 /** |
61 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap | 72 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap |
62 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng | 73 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng |
63 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). | 74 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). |
64 * @param SkReadBuffer Serialized picture data. | 75 * @param SkReadBuffer Serialized picture data. |
65 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is | 76 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is |
66 * invalid. | 77 * invalid. |
67 */ | 78 */ |
68 static SkPicture* CreateFromBuffer(SkReadBuffer&); | 79 static SkPicture* CreateFromBuffer(SkReadBuffer&); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 static bool IsValidPictInfo(const SkPictInfo& info); | 209 static bool IsValidPictInfo(const SkPictInfo& info); |
199 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 210 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
200 | 211 |
201 SkPictInfo createHeader() const; | 212 SkPictInfo createHeader() const; |
202 SkPictureData* backport() const; | 213 SkPictureData* backport() const; |
203 | 214 |
204 mutable uint32_t fUniqueID; | 215 mutable uint32_t fUniqueID; |
205 }; | 216 }; |
206 | 217 |
207 #endif | 218 #endif |
OLD | NEW |