| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2007 The Android Open Source Project | 3 * Copyright 2007 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkPicture_DEFINED | 10 #ifndef SkPicture_DEFINED |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class SkWStream; | 29 class SkWStream; |
| 30 | 30 |
| 31 struct SkPictInfo; | 31 struct SkPictInfo; |
| 32 | 32 |
| 33 class SkRecord; | 33 class SkRecord; |
| 34 | 34 |
| 35 namespace SkRecords { | 35 namespace SkRecords { |
| 36 class CollectLayers; | 36 class CollectLayers; |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 //#define SK_LEGACY_ENCODE_BITMAP | |
| 40 | |
| 41 /** \class SkPicture | 39 /** \class SkPicture |
| 42 | 40 |
| 43 The SkPicture class records the drawing commands made to a canvas, to | 41 The SkPicture class records the drawing commands made to a canvas, to |
| 44 be played back at a later time. | 42 be played back at a later time. |
| 45 */ | 43 */ |
| 46 class SK_API SkPicture : public SkNVRefCnt<SkPicture> { | 44 class SK_API SkPicture : public SkNVRefCnt<SkPicture> { |
| 47 public: | 45 public: |
| 48 // AccelData provides a base class for device-specific acceleration | 46 // AccelData provides a base class for device-specific acceleration |
| 49 // data. It is added to the picture via EXPERIMENTAL_addAccelData. | 47 // data. It is added to the picture via EXPERIMENTAL_addAccelData. |
| 50 class AccelData : public SkRefCnt { | 48 class AccelData : public SkRefCnt { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 * | 130 * |
| 133 * @param pixelRefOffset DEPRECATED -- caller assumes it will return 0. | 131 * @param pixelRefOffset DEPRECATED -- caller assumes it will return 0. |
| 134 * @return SkData If non-NULL, holds encoded data representing the passed | 132 * @return SkData If non-NULL, holds encoded data representing the passed |
| 135 * in bitmap. The caller is responsible for calling unref(). | 133 * in bitmap. The caller is responsible for calling unref(). |
| 136 * | 134 * |
| 137 * TODO: No longer used by SkPicture (except when SK_LEGACY_ENCODE_BITMAP | 135 * TODO: No longer used by SkPicture (except when SK_LEGACY_ENCODE_BITMAP |
| 138 * is defined. Still used by PDF though. Move into PDF. | 136 * is defined. Still used by PDF though. Move into PDF. |
| 139 */ | 137 */ |
| 140 typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm); | 138 typedef SkData* (*EncodeBitmap)(size_t* pixelRefOffset, const SkBitmap& bm); |
| 141 | 139 |
| 142 #ifdef SK_LEGACY_ENCODE_BITMAP | |
| 143 /** | |
| 144 * Serialize to a stream. If non NULL, encoder will be used to encode | |
| 145 * any bitmaps in the picture. | |
| 146 * encoder will never be called with a NULL pixelRefOffset. | |
| 147 * DEPRECATED - use serialize(SkWStream*, SkPixelSerializer* serializer) | |
| 148 * instead. | |
| 149 */ | |
| 150 void serialize(SkWStream* wStream, EncodeBitmap encoder) const; | |
| 151 #endif | |
| 152 | |
| 153 /** | 140 /** |
| 154 * Serialize to a stream. If non NULL, serializer will be used to serialize | 141 * Serialize to a stream. If non NULL, serializer will be used to serialize |
| 155 * any bitmaps in the picture. | 142 * any bitmaps in the picture. |
| 156 * | 143 * |
| 157 * TODO: Use serializer to serialize SkImages as well. | 144 * TODO: Use serializer to serialize SkImages as well. |
| 158 */ | 145 */ |
| 159 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const; | 146 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const; |
| 160 | 147 |
| 161 /** | 148 /** |
| 162 * Serialize to a buffer. | 149 * Serialize to a buffer. |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 292 |
| 306 friend class SkPictureRecorder; // SkRecord-based constructor. | 293 friend class SkPictureRecorder; // SkRecord-based constructor. |
| 307 friend class GrLayerHoister; // access to fRecord | 294 friend class GrLayerHoister; // access to fRecord |
| 308 friend class ReplaceDraw; | 295 friend class ReplaceDraw; |
| 309 friend class SkPictureUtils; | 296 friend class SkPictureUtils; |
| 310 friend class SkRecordedDrawable; | 297 friend class SkRecordedDrawable; |
| 311 }; | 298 }; |
| 312 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); | 299 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); |
| 313 | 300 |
| 314 #endif | 301 #endif |
| OLD | NEW |