| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 /** | 70 /** |
| 71 * Recreate a picture that was serialized into a stream. | 71 * Recreate a picture that was serialized into a stream. |
| 72 * | 72 * |
| 73 * Any serialized images in the stream will be passed the image-deserialize
r, or if that is | 73 * Any serialized images in the stream will be passed the image-deserialize
r, or if that is |
| 74 * null, to the default deserializer that will call SkImage::MakeFromEncode
d(). | 74 * null, to the default deserializer that will call SkImage::MakeFromEncode
d(). |
| 75 */ | 75 */ |
| 76 static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*); | 76 static sk_sp<SkPicture> MakeFromStream(SkStream*, SkImageDeserializer*); |
| 77 static sk_sp<SkPicture> MakeFromStream(SkStream*); | 77 static sk_sp<SkPicture> MakeFromStream(SkStream*); |
| 78 static sk_sp<SkPicture> MakeFromData(const void* data, size_t size, |
| 79 SkImageDeserializer* = nullptr); |
| 80 static sk_sp<SkPicture> MakeFromData(const SkData* data, SkImageDeserializer
* = nullptr); |
| 78 | 81 |
| 79 /** | 82 /** |
| 80 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap | 83 * Recreate a picture that was serialized into a buffer. If the creation re
quires bitmap |
| 81 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng | 84 * decoding, the decoder must be set on the SkReadBuffer parameter by calli
ng |
| 82 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). | 85 * SkReadBuffer::setBitmapDecoder() before calling SkPicture::CreateFromBuf
fer(). |
| 83 * @param SkReadBuffer Serialized picture data. | 86 * @param SkReadBuffer Serialized picture data. |
| 84 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is | 87 * @return A new SkPicture representing the serialized data, or NULL if the
buffer is |
| 85 * invalid. | 88 * invalid. |
| 86 */ | 89 */ |
| 87 static sk_sp<SkPicture> MakeFromBuffer(SkReadBuffer&); | 90 static sk_sp<SkPicture> MakeFromBuffer(SkReadBuffer&); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 114 | 117 |
| 115 /** Return a cull rect for this picture. | 118 /** Return a cull rect for this picture. |
| 116 Ops recorded into this picture that attempt to draw outside the cull mig
ht not be drawn. | 119 Ops recorded into this picture that attempt to draw outside the cull mig
ht not be drawn. |
| 117 */ | 120 */ |
| 118 virtual SkRect cullRect() const = 0; | 121 virtual SkRect cullRect() const = 0; |
| 119 | 122 |
| 120 /** Returns a non-zero value unique among all pictures. */ | 123 /** Returns a non-zero value unique among all pictures. */ |
| 121 uint32_t uniqueID() const; | 124 uint32_t uniqueID() const; |
| 122 | 125 |
| 123 /** | 126 /** |
| 124 * Serialize to a stream. If non NULL, serializer will be used to serialize | 127 * Serialize the picture to SkData. If non nullptr, pixel-serializer will b
e used to |
| 125 * bitmaps and images in the picture. | 128 * customize how images reference by the picture are serialized/compressed. |
| 126 */ | 129 */ |
| 127 void serialize(SkWStream*, SkPixelSerializer* = NULL) const; | 130 sk_sp<SkData> serialize(SkPixelSerializer* = nullptr) const; |
| 131 |
| 132 /** |
| 133 * Serialize to a stream. If non nullptr, pixel-serializer will be used to |
| 134 * customize how images reference by the picture are serialized/compressed. |
| 135 */ |
| 136 void serialize(SkWStream*, SkPixelSerializer* = nullptr) const; |
| 128 | 137 |
| 129 /** | 138 /** |
| 130 * Serialize to a buffer. | 139 * Serialize to a buffer. |
| 131 */ | 140 */ |
| 132 void flatten(SkWriteBuffer&) const; | 141 void flatten(SkWriteBuffer&) const; |
| 133 | 142 |
| 134 /** | 143 /** |
| 135 * Returns true if any bitmaps may be produced when this SkPicture | 144 * Returns true if any bitmaps may be produced when this SkPicture |
| 136 * is replayed. | 145 * is replayed. |
| 137 */ | 146 */ |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 const SkPictureData*, | 245 const SkPictureData*, |
| 237 const SkReadBuffer* buffer); | 246 const SkReadBuffer* buffer); |
| 238 | 247 |
| 239 SkPictInfo createHeader() const; | 248 SkPictInfo createHeader() const; |
| 240 SkPictureData* backport() const; | 249 SkPictureData* backport() const; |
| 241 | 250 |
| 242 mutable uint32_t fUniqueID; | 251 mutable uint32_t fUniqueID; |
| 243 }; | 252 }; |
| 244 | 253 |
| 245 #endif | 254 #endif |
| OLD | NEW |