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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 CCResourceProvider::ResourceId resourceId() const; | 74 CCResourceProvider::ResourceId resourceId() const; |
75 | 75 |
76 // Self-managed textures are accounted for when prioritizing other textures, | 76 // Self-managed textures are accounted for when prioritizing other textures, |
77 // but they are not allocated/recycled/deleted, so this needs to be done | 77 // but they are not allocated/recycled/deleted, so this needs to be done |
78 // externally. canAcquireBackingTexture() indicates if the texture would hav
e | 78 // externally. canAcquireBackingTexture() indicates if the texture would hav
e |
79 // been allowed given its priority. | 79 // been allowed given its priority. |
80 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} | 80 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} |
81 bool isSelfManaged() { return m_isSelfManaged; } | 81 bool isSelfManaged() { return m_isSelfManaged; } |
82 void setToSelfManagedMemoryPlaceholder(size_t bytes); | 82 void setToSelfManagedMemoryPlaceholder(size_t bytes); |
83 | 83 |
| 84 void returnBackingTexture(); |
| 85 |
84 private: | 86 private: |
85 friend class CCPrioritizedTextureManager; | 87 friend class CCPrioritizedTextureManager; |
86 friend class CCPrioritizedTextureTest; | 88 friend class CCPrioritizedTextureTest; |
87 | 89 |
88 class Backing : public CCTexture { | 90 class Backing : public CCTexture { |
89 public: | 91 public: |
90 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); | 92 Backing(unsigned id, CCResourceProvider*, IntSize, GC3Denum format); |
91 ~Backing(); | 93 ~Backing(); |
92 void updatePriority(); | 94 void updatePriority(); |
93 void updateInDrawingImplTree(); | 95 void updateInDrawingImplTree(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 140 |
139 Backing* m_backing; | 141 Backing* m_backing; |
140 CCPrioritizedTextureManager* m_manager; | 142 CCPrioritizedTextureManager* m_manager; |
141 | 143 |
142 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); | 144 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); |
143 }; | 145 }; |
144 | 146 |
145 } // namespace cc | 147 } // namespace cc |
146 | 148 |
147 #endif | 149 #endif |
OLD | NEW |