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 | 8 |
9 #ifndef SkPicture_DEFINED | 9 #ifndef SkPicture_DEFINED |
10 #define SkPicture_DEFINED | 10 #define SkPicture_DEFINED |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 It does not necessarily reflect the bounds of what has been recorded int
o the picture. | 132 It does not necessarily reflect the bounds of what has been recorded int
o the picture. |
133 @return the cull rect used to create this picture | 133 @return the cull rect used to create this picture |
134 */ | 134 */ |
135 SkRect cullRect() const { return fCullRect; } | 135 SkRect cullRect() const { return fCullRect; } |
136 | 136 |
137 /** Return a non-zero, unique value representing the picture. | 137 /** Return a non-zero, unique value representing the picture. |
138 */ | 138 */ |
139 uint32_t uniqueID() const { return fUniqueID; } | 139 uint32_t uniqueID() const { return fUniqueID; } |
140 | 140 |
141 /** | 141 /** |
142 * Function to encode an SkBitmap to an SkData. A function with this | |
143 * signature can be passed to serialize() and SkWriteBuffer. | |
144 * Returning NULL will tell the SkWriteBuffer to use | |
145 * SkBitmap::flatten() to store the bitmap. | |
146 * | |
147 * @param pixelRefOffset DEPRECATED -- caller assumes it will return 0. | |
148 * @return SkData If non-NULL, holds encoded data representing the passed | |
149 * in bitmap. The caller is responsible for calling unref(). | |
150 * | |
151 * TODO: No longer used by SkPicture. Still used by PDF though. Move into P
DF. | |
152 */ | |
153 typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm); | |
154 | |
155 /** | |
156 * Serialize to a stream. If non NULL, serializer will be used to serialize | 142 * Serialize to a stream. If non NULL, serializer will be used to serialize |
157 * any bitmaps in the picture. | 143 * any bitmaps in the picture. |
158 * | 144 * |
159 * TODO: Use serializer to serialize SkImages as well. | 145 * TODO: Use serializer to serialize SkImages as well. |
160 */ | 146 */ |
161 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const; | 147 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const; |
162 | 148 |
163 /** | 149 /** |
164 * Serialize to a buffer. | 150 * Serialize to a buffer. |
165 */ | 151 */ |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 | 293 |
308 friend class SkPictureRecorder; // SkRecord-based constructor. | 294 friend class SkPictureRecorder; // SkRecord-based constructor. |
309 friend class GrLayerHoister; // access to fRecord | 295 friend class GrLayerHoister; // access to fRecord |
310 friend class ReplaceDraw; | 296 friend class ReplaceDraw; |
311 friend class SkPictureUtils; | 297 friend class SkPictureUtils; |
312 friend class SkRecordedDrawable; | 298 friend class SkRecordedDrawable; |
313 }; | 299 }; |
314 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); | 300 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); |
315 | 301 |
316 #endif | 302 #endif |
OLD | NEW |