Chromium Code Reviews| 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. | |
|
scroggo
2016/02/09 16:12:17
Should I include a comment alluding to how we'll d
reed1
2016/02/09 20:46:26
Sure. Something like...?
Serialized images will b
scroggo
2016/02/09 21:07:14
Done - used SkIMageGenerator::NewFromEncoded, whic
| |
| 61 * @param SkStream Serialized picture data. Ownership is unchanged by this call. | |
| 62 * @return A new SkPicture representing the serialized data, or NULL if the stream is | |
| 63 * invalid. | |
| 64 */ | |
| 65 static SkPicture* CreateFromStream(SkStream*); | |
| 59 | 66 |
| 60 /** | 67 /** |
| 61 * Recreate a picture that was serialized into a buffer. If the creation re quires bitmap | 68 * 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 | 69 * decoding, the decoder must be set on the SkReadBuffer parameter by calli ng |
| 63 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf fer(). | 70 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf fer(). |
| 64 * @param SkReadBuffer Serialized picture data. | 71 * @param SkReadBuffer Serialized picture data. |
| 65 * @return A new SkPicture representing the serialized data, or NULL if the buffer is | 72 * @return A new SkPicture representing the serialized data, or NULL if the buffer is |
| 66 * invalid. | 73 * invalid. |
| 67 */ | 74 */ |
| 68 static SkPicture* CreateFromBuffer(SkReadBuffer&); | 75 static SkPicture* CreateFromBuffer(SkReadBuffer&); |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 static bool IsValidPictInfo(const SkPictInfo& info); | 205 static bool IsValidPictInfo(const SkPictInfo& info); |
| 199 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 206 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
| 200 | 207 |
| 201 SkPictInfo createHeader() const; | 208 SkPictInfo createHeader() const; |
| 202 SkPictureData* backport() const; | 209 SkPictureData* backport() const; |
| 203 | 210 |
| 204 mutable uint32_t fUniqueID; | 211 mutable uint32_t fUniqueID; |
| 205 }; | 212 }; |
| 206 | 213 |
| 207 #endif | 214 #endif |
| OLD | NEW |