OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
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 #ifndef SkBitmapHeap_DEFINED | 8 #ifndef SkBitmapHeap_DEFINED |
9 #define SkBitmapHeap_DEFINED | 9 #define SkBitmapHeap_DEFINED |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 * Our LRU implementation assumes that inserts into the external storage are
consumed in the | 104 * Our LRU implementation assumes that inserts into the external storage are
consumed in the |
105 * order that they are inserted (i.e. SkPipe). This ensures that we don't ne
ed to query the | 105 * order that they are inserted (i.e. SkPipe). This ensures that we don't ne
ed to query the |
106 * external storage to see if a slot in the heap is eligible to be overwritt
en. | 106 * external storage to see if a slot in the heap is eligible to be overwritt
en. |
107 * | 107 * |
108 * @param externalStorage The class responsible for storing the bitmaps ins
erted into the heap | 108 * @param externalStorage The class responsible for storing the bitmaps ins
erted into the heap |
109 * @param heapSize The maximum size of the heap. Because of the sequential
limitation imposed | 109 * @param heapSize The maximum size of the heap. Because of the sequential
limitation imposed |
110 * by our LRU implementation we can guarantee that the heap will never gro
w beyond this size. | 110 * by our LRU implementation we can guarantee that the heap will never gro
w beyond this size. |
111 */ | 111 */ |
112 SkBitmapHeap(ExternalStorage* externalStorage, int32_t heapSize = UNLIMITED_
SIZE); | 112 SkBitmapHeap(ExternalStorage* externalStorage, int32_t heapSize = UNLIMITED_
SIZE); |
113 | 113 |
114 ~SkBitmapHeap(); | 114 virtual ~SkBitmapHeap(); |
115 | 115 |
116 /** | 116 /** |
117 * Makes a shallow copy of all bitmaps currently in the heap and returns the
m as an array. The | 117 * Makes a shallow copy of all bitmaps currently in the heap and returns the
m as an array. The |
118 * array indices match their position in the heap. | 118 * array indices match their position in the heap. |
119 * | 119 * |
120 * @return a ptr to an array of bitmaps or NULL if external storage is bein
g used. | 120 * @return a ptr to an array of bitmaps or NULL if external storage is bein
g used. |
121 */ | 121 */ |
122 SkTRefArray<SkBitmap>* extractBitmaps() const; | 122 SkTRefArray<SkBitmap>* extractBitmaps() const; |
123 | 123 |
124 /** | 124 /** |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 const int32_t fOwnerCount; | 298 const int32_t fOwnerCount; |
299 size_t fBytesAllocated; | 299 size_t fBytesAllocated; |
300 | 300 |
301 bool fDeferAddingOwners; | 301 bool fDeferAddingOwners; |
302 SkTDArray<int> fDeferredEntries; | 302 SkTDArray<int> fDeferredEntries; |
303 | 303 |
304 typedef SkBitmapHeapReader INHERITED; | 304 typedef SkBitmapHeapReader INHERITED; |
305 }; | 305 }; |
306 | 306 |
307 #endif // SkBitmapHeap_DEFINED | 307 #endif // SkBitmapHeap_DEFINED |
OLD | NEW |