OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 SkBitmapCache_DEFINED | 8 #ifndef SkBitmapCache_DEFINED |
9 #define SkBitmapCache_DEFINED | 9 #define SkBitmapCache_DEFINED |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 */ | 41 */ |
42 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result, | 42 static bool Find(uint32_t genID, const SkIRect& subset, SkBitmap* result, |
43 SkResourceCache* localCache = NULL); | 43 SkResourceCache* localCache = NULL); |
44 | 44 |
45 /** | 45 /** |
46 * The width and the height of the provided subset must be the same as the r
esult bitmap ones. | 46 * The width and the height of the provided subset must be the same as the r
esult bitmap ones. |
47 * result must be marked isImmutable() | 47 * result must be marked isImmutable() |
48 */ | 48 */ |
49 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul
t, | 49 static bool Add(uint32_t genID, const SkIRect& subset, const SkBitmap& resul
t, |
50 SkResourceCache* localCache = NULL); | 50 SkResourceCache* localCache = NULL); |
| 51 |
| 52 /** |
| 53 * Call this to (as a hint) preemptively purge caches related to this genID |
| 54 */ |
| 55 static void NotifyGenIDStale(uint32_t); |
51 }; | 56 }; |
52 | 57 |
53 class SkMipMapCache { | 58 class SkMipMapCache { |
54 public: | 59 public: |
55 static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* loca
lCache = NULL); | 60 static const SkMipMap* FindAndRef(const SkBitmap& src, SkResourceCache* loca
lCache = NULL); |
56 static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* local
Cache = NULL); | 61 static const SkMipMap* AddAndRef(const SkBitmap& src, SkResourceCache* local
Cache = NULL); |
| 62 |
| 63 /** |
| 64 * Call this to (as a hint) preemptively purge caches related to this genID |
| 65 */ |
| 66 static void NotifyGenIDStale(uint32_t); |
57 }; | 67 }; |
58 | 68 |
59 #endif | 69 #endif |
OLD | NEW |