| 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 "IntRect.h" | 8 #include "IntRect.h" |
| 9 #include "IntSize.h" | 9 #include "IntSize.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 ResourceProvider::ResourceId resourceId() const; | 76 ResourceProvider::ResourceId resourceId() const; |
| 77 | 77 |
| 78 // Self-managed textures are accounted for when prioritizing other textures, | 78 // Self-managed textures are accounted for when prioritizing other textures, |
| 79 // but they are not allocated/recycled/deleted, so this needs to be done | 79 // but they are not allocated/recycled/deleted, so this needs to be done |
| 80 // externally. canAcquireBackingTexture() indicates if the texture would hav
e | 80 // externally. canAcquireBackingTexture() indicates if the texture would hav
e |
| 81 // been allowed given its priority. | 81 // been allowed given its priority. |
| 82 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} | 82 void setIsSelfManaged(bool isSelfManaged) { m_isSelfManaged = isSelfManaged;
} |
| 83 bool isSelfManaged() { return m_isSelfManaged; } | 83 bool isSelfManaged() { return m_isSelfManaged; } |
| 84 void setToSelfManagedMemoryPlaceholder(size_t bytes); | 84 void setToSelfManagedMemoryPlaceholder(size_t bytes); |
| 85 | 85 |
| 86 void returnBackingTexture(); |
| 87 |
| 86 private: | 88 private: |
| 87 friend class PrioritizedTextureManager; | 89 friend class PrioritizedTextureManager; |
| 88 friend class PrioritizedTextureTest; | 90 friend class PrioritizedTextureTest; |
| 89 | 91 |
| 90 class Backing : public Texture { | 92 class Backing : public Texture { |
| 91 public: | 93 public: |
| 92 Backing(unsigned id, ResourceProvider*, IntSize, GLenum format); | 94 Backing(unsigned id, ResourceProvider*, IntSize, GLenum format); |
| 93 ~Backing(); | 95 ~Backing(); |
| 94 void updatePriority(); | 96 void updatePriority(); |
| 95 void updateInDrawingImplTree(); | 97 void updateInDrawingImplTree(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 143 |
| 142 Backing* m_backing; | 144 Backing* m_backing; |
| 143 PrioritizedTextureManager* m_manager; | 145 PrioritizedTextureManager* m_manager; |
| 144 | 146 |
| 145 DISALLOW_COPY_AND_ASSIGN(PrioritizedTexture); | 147 DISALLOW_COPY_AND_ASSIGN(PrioritizedTexture); |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 } // namespace cc | 150 } // namespace cc |
| 149 | 151 |
| 150 #endif | 152 #endif |
| OLD | NEW |