| OLD | NEW |
| 1 | |
| 2 /* | 1 /* |
| 3 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 4 * | 3 * |
| 5 * 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 |
| 6 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 7 */ | 6 */ |
| 8 | 7 |
| 9 | |
| 10 #ifndef GrResource_DEFINED | 8 #ifndef GrResource_DEFINED |
| 11 #define GrResource_DEFINED | 9 #define GrResource_DEFINED |
| 12 | 10 |
| 13 #include "GrRefCnt.h" | 11 #include "SkRefCnt.h" |
| 14 | |
| 15 #include "SkTInternalLList.h" | 12 #include "SkTInternalLList.h" |
| 16 | 13 |
| 17 class GrGpu; | 14 class GrGpu; |
| 18 class GrContext; | 15 class GrContext; |
| 19 class GrResourceEntry; | 16 class GrResourceEntry; |
| 20 | 17 |
| 21 /** | 18 /** |
| 22 * Base class for the GPU resources created by a GrContext. | 19 * Base class for the GPU resources created by a GrContext. |
| 23 */ | 20 */ |
| 24 class GrResource : public GrRefCnt { | 21 class GrResource : public SkRefCnt { |
| 25 public: | 22 public: |
| 26 SK_DECLARE_INST_COUNT(GrResource) | 23 SK_DECLARE_INST_COUNT(GrResource) |
| 27 | 24 |
| 28 /** | 25 /** |
| 29 * Frees the resource in the underlying 3D API. It must be safe to call this | 26 * Frees the resource in the underlying 3D API. It must be safe to call this |
| 30 * when the resource has been previously abandoned. | 27 * when the resource has been previously abandoned. |
| 31 */ | 28 */ |
| 32 void release(); | 29 void release(); |
| 33 | 30 |
| 34 /** | 31 /** |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 // release() on all such resources i
n its | 101 // release() on all such resources i
n its |
| 105 // destructor. | 102 // destructor. |
| 106 GrResourceEntry* fCacheEntry; // NULL if not in cache | 103 GrResourceEntry* fCacheEntry; // NULL if not in cache |
| 107 mutable int fDeferredRefCount; // How many references in deferred d
rawing buffers. | 104 mutable int fDeferredRefCount; // How many references in deferred d
rawing buffers. |
| 108 | 105 |
| 109 enum Flags { | 106 enum Flags { |
| 110 kWrapped_Flag = 0x1, | 107 kWrapped_Flag = 0x1, |
| 111 }; | 108 }; |
| 112 uint32_t fFlags; | 109 uint32_t fFlags; |
| 113 | 110 |
| 114 typedef GrRefCnt INHERITED; | 111 typedef SkRefCnt INHERITED; |
| 115 }; | 112 }; |
| 116 | 113 |
| 117 #endif | 114 #endif |
| OLD | NEW |