| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 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 SkImageGenerator_DEFINED | 8 #ifndef SkImageGenerator_DEFINED |
| 9 #define SkImageGenerator_DEFINED | 9 #define SkImageGenerator_DEFINED |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * SkDELETE() on the generator. Therefore, generator should be | 28 * SkDELETE() on the generator. Therefore, generator should be |
| 29 * allocated with SkNEW() or SkNEW_ARGS(). | 29 * allocated with SkNEW() or SkNEW_ARGS(). |
| 30 * | 30 * |
| 31 * @param destination Upon success, this bitmap will be | 31 * @param destination Upon success, this bitmap will be |
| 32 * configured and have a pixelref installed. | 32 * configured and have a pixelref installed. |
| 33 * | 33 * |
| 34 * @return true iff successful. | 34 * @return true iff successful. |
| 35 */ | 35 */ |
| 36 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio
n); | 36 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio
n); |
| 37 | 37 |
| 38 /** | |
| 39 * Purges all unlocked discardable memory in Skia's global | |
| 40 * discardable memory pool. | |
| 41 */ | |
| 42 SK_API void SkPurgeGlobalDiscardableMemoryPool(); | |
| 43 | |
| 44 | 38 |
| 45 /** | 39 /** |
| 46 * An interface that allows a purgeable PixelRef (such as a | 40 * An interface that allows a purgeable PixelRef (such as a |
| 47 * SkDiscardablePixelRef) to decode and re-decode an image as needed. | 41 * SkDiscardablePixelRef) to decode and re-decode an image as needed. |
| 48 */ | 42 */ |
| 49 class SK_API SkImageGenerator { | 43 class SK_API SkImageGenerator { |
| 50 public: | 44 public: |
| 51 /** | 45 /** |
| 52 * The PixelRef which takes ownership of this SkImageGenerator | 46 * The PixelRef which takes ownership of this SkImageGenerator |
| 53 * will call the image generator's destructor. | 47 * will call the image generator's destructor. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 protected: | 126 protected: |
| 133 virtual SkData* onRefEncodedData(); | 127 virtual SkData* onRefEncodedData(); |
| 134 virtual bool onGetInfo(SkImageInfo* info); | 128 virtual bool onGetInfo(SkImageInfo* info); |
| 135 virtual bool onGetPixels(const SkImageInfo& info, | 129 virtual bool onGetPixels(const SkImageInfo& info, |
| 136 void* pixels, size_t rowBytes, | 130 void* pixels, size_t rowBytes, |
| 137 SkPMColor ctable[], int* ctableCount); | 131 SkPMColor ctable[], int* ctableCount); |
| 138 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3]); | 132 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3]); |
| 139 }; | 133 }; |
| 140 | 134 |
| 141 #endif // SkImageGenerator_DEFINED | 135 #endif // SkImageGenerator_DEFINED |
| OLD | NEW |