| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CCPrioritizedTexture_h | 5 #ifndef CCPrioritizedTexture_h |
| 6 #define CCPrioritizedTexture_h | 6 #define CCPrioritizedTexture_h |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "CCPriorityCalculator.h" | 10 #include "CCPriorityCalculator.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 friend class CCPrioritizedTextureManager; | 85 friend class CCPrioritizedTextureManager; |
| 86 friend class CCPrioritizedTextureTest; | 86 friend class CCPrioritizedTextureTest; |
| 87 | 87 |
| 88 class Backing : public CCTexture { | 88 class Backing : public CCTexture { |
| 89 public: | 89 public: |
| 90 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); | 90 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); |
| 91 ~Backing(); | 91 ~Backing(); |
| 92 void updatePriority(); | 92 void updatePriority(); |
| 93 void updateInDrawingImplTree(); |
| 93 | 94 |
| 94 CCPrioritizedTexture* owner() { return m_owner; } | 95 CCPrioritizedTexture* owner() { return m_owner; } |
| 95 bool hadOwnerAtLastPriorityUpdate() const { return m_ownerExistedAtLastP
riorityUpdate; } | 96 bool canBeRecycled() const; |
| 96 int requestPriorityAtLastPriorityUpdate() const { return m_priorityAtLas
tPriorityUpdate; } | 97 int requestPriorityAtLastPriorityUpdate() const { return m_priorityAtLas
tPriorityUpdate; } |
| 97 bool wasAbovePriorityCutoffAtLastPriorityUpdate() const { return m_wasAb
ovePriorityCutoffAtLastPriorityUpdate; } | 98 bool wasAbovePriorityCutoffAtLastPriorityUpdate() const { return m_wasAb
ovePriorityCutoffAtLastPriorityUpdate; } |
| 99 bool inDrawingImplTree() const { return m_inDrawingImplTree; } |
| 98 | 100 |
| 99 void deleteResource(CCResourceProvider*); | 101 void deleteResource(CCResourceProvider*); |
| 100 bool resourceHasBeenDeleted() const; | 102 bool resourceHasBeenDeleted() const; |
| 101 | 103 |
| 102 private: | 104 private: |
| 103 friend class CCPrioritizedTexture; | 105 friend class CCPrioritizedTexture; |
| 104 CCPrioritizedTexture* m_owner; | 106 CCPrioritizedTexture* m_owner; |
| 105 int m_priorityAtLastPriorityUpdate; | 107 int m_priorityAtLastPriorityUpdate; |
| 106 bool m_ownerExistedAtLastPriorityUpdate; | |
| 107 bool m_wasAbovePriorityCutoffAtLastPriorityUpdate; | 108 bool m_wasAbovePriorityCutoffAtLastPriorityUpdate; |
| 109 |
| 110 // Set if this is currently-drawing impl tree. |
| 111 bool m_inDrawingImplTree; |
| 112 |
| 108 bool m_resourceHasBeenDeleted; | 113 bool m_resourceHasBeenDeleted; |
| 109 #ifndef NDEBUG | 114 #ifndef NDEBUG |
| 110 CCResourceProvider* m_resourceProvider; | 115 CCResourceProvider* m_resourceProvider; |
| 111 #endif | 116 #endif |
| 112 | 117 |
| 113 DISALLOW_COPY_AND_ASSIGN(Backing); | 118 DISALLOW_COPY_AND_ASSIGN(Backing); |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 CCPrioritizedTexture(CCPrioritizedTextureManager*, IntSize, GC3Denum format)
; | 121 CCPrioritizedTexture(CCPrioritizedTextureManager*, IntSize, GC3Denum format)
; |
| 117 | 122 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 133 | 138 |
| 134 Backing* m_backing; | 139 Backing* m_backing; |
| 135 CCPrioritizedTextureManager* m_manager; | 140 CCPrioritizedTextureManager* m_manager; |
| 136 | 141 |
| 137 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); | 142 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); |
| 138 }; | 143 }; |
| 139 | 144 |
| 140 } // namespace cc | 145 } // namespace cc |
| 141 | 146 |
| 142 #endif | 147 #endif |
| OLD | NEW |