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 16 matching lines...) Expand all Loading... |
27 * SkDELETE() on the generator. Therefore, generator should be | 27 * SkDELETE() on the generator. Therefore, generator should be |
28 * allocated with SkNEW() or SkNEW_ARGS(). | 28 * allocated with SkNEW() or SkNEW_ARGS(). |
29 * | 29 * |
30 * @param destination Upon success, this bitmap will be | 30 * @param destination Upon success, this bitmap will be |
31 * configured and have a pixelref installed. | 31 * configured and have a pixelref installed. |
32 * | 32 * |
33 * @return true iff successful. | 33 * @return true iff successful. |
34 */ | 34 */ |
35 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio
n); | 35 SK_API bool SkInstallDiscardablePixelRef(SkImageGenerator*, SkBitmap* destinatio
n); |
36 | 36 |
| 37 /** |
| 38 * Purges all unlocked discardable memory in Skia's global |
| 39 * discardable memory pool. |
| 40 */ |
| 41 SK_API void SkPurgeGlobalDiscardableMemoryPool(); |
| 42 |
37 | 43 |
38 /** | 44 /** |
39 * An interface that allows a purgeable PixelRef (such as a | 45 * An interface that allows a purgeable PixelRef (such as a |
40 * SkDiscardablePixelRef) to decode and re-decode an image as needed. | 46 * SkDiscardablePixelRef) to decode and re-decode an image as needed. |
41 */ | 47 */ |
42 class SK_API SkImageGenerator { | 48 class SK_API SkImageGenerator { |
43 public: | 49 public: |
44 /** | 50 /** |
45 * The PixelRef which takes ownership of this SkImageGenerator | 51 * The PixelRef which takes ownership of this SkImageGenerator |
46 * will call the image generator's destructor. | 52 * will call the image generator's destructor. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 * | 91 * |
86 * @return false if anything goes wrong or if the image info is | 92 * @return false if anything goes wrong or if the image info is |
87 * unsupported. | 93 * unsupported. |
88 */ | 94 */ |
89 virtual bool getPixels(const SkImageInfo& info, | 95 virtual bool getPixels(const SkImageInfo& info, |
90 void* pixels, | 96 void* pixels, |
91 size_t rowBytes) = 0; | 97 size_t rowBytes) = 0; |
92 }; | 98 }; |
93 | 99 |
94 #endif // SkImageGenerator_DEFINED | 100 #endif // SkImageGenerator_DEFINED |
OLD | NEW |