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 GrGpuResource_DEFINED | 8 #ifndef GrGpuResource_DEFINED |
9 #define GrGpuResource_DEFINED | 9 #define GrGpuResource_DEFINED |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 return fGpuMemorySize; | 181 return fGpuMemorySize; |
182 } | 182 } |
183 | 183 |
184 /** | 184 /** |
185 * Gets an id that is unique for this GrGpuResource object. It is static in
that it does | 185 * Gets an id that is unique for this GrGpuResource object. It is static in
that it does |
186 * not change when the content of the GrGpuResource object changes. This wil
l never return | 186 * not change when the content of the GrGpuResource object changes. This wil
l never return |
187 * 0. | 187 * 0. |
188 */ | 188 */ |
189 uint32_t getUniqueID() const { return fUniqueID; } | 189 uint32_t getUniqueID() const { return fUniqueID; } |
190 | 190 |
| 191 /** Returns the current content key for the resource. It will be invalid if
the resource has not |
| 192 been cached by its contents. */ |
| 193 const GrContentKey& getContentKey() const { return fContentKey; } |
| 194 |
191 /** | 195 /** |
192 * Attach a custom data object to this resource. The data will remain attach
ed | 196 * Attach a custom data object to this resource. The data will remain attach
ed |
193 * for the lifetime of this resource (until it is abandoned or released). | 197 * for the lifetime of this resource (until it is abandoned or released). |
194 * Takes a ref on data. Previously attached data, if any, is unrefed. | 198 * Takes a ref on data. Previously attached data, if any, is unrefed. |
195 * Returns the data argument, for convenience. | 199 * Returns the data argument, for convenience. |
196 */ | 200 */ |
197 const SkData* setCustomData(const SkData* data); | 201 const SkData* setCustomData(const SkData* data); |
198 | 202 |
199 /** | 203 /** |
200 * Returns the custom data object that was attached to this resource by | 204 * Returns the custom data object that was attached to this resource by |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 LifeCycle fLifeCycle; | 291 LifeCycle fLifeCycle; |
288 const uint32_t fUniqueID; | 292 const uint32_t fUniqueID; |
289 | 293 |
290 SkAutoTUnref<const SkData> fData; | 294 SkAutoTUnref<const SkData> fData; |
291 | 295 |
292 typedef GrIORef<GrGpuResource> INHERITED; | 296 typedef GrIORef<GrGpuResource> INHERITED; |
293 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgeable. | 297 friend class GrIORef<GrGpuResource>; // to access notifyIsPurgeable. |
294 }; | 298 }; |
295 | 299 |
296 #endif | 300 #endif |
OLD | NEW |