| 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 "CCPriorityCalculator.h" | 10 #include "CCPriorityCalculator.h" |
| 10 #include "CCResourceProvider.h" | 11 #include "CCResourceProvider.h" |
| 11 #include "CCTexture.h" | 12 #include "CCTexture.h" |
| 12 #include "GraphicsContext3D.h" | 13 #include "GraphicsContext3D.h" |
| 13 #include "IntRect.h" | 14 #include "IntRect.h" |
| 14 #include "IntSize.h" | 15 #include "IntSize.h" |
| 15 | 16 |
| 16 namespace cc { | 17 namespace cc { |
| 17 | 18 |
| 18 class CCPrioritizedTextureManager; | 19 class CCPrioritizedTextureManager; |
| 19 | 20 |
| 20 class CCPrioritizedTexture { | 21 class CCPrioritizedTexture { |
| 21 public: | 22 public: |
| 22 static PassOwnPtr<CCPrioritizedTexture> create(CCPrioritizedTextureManager*
manager, IntSize size, GC3Denum format) | 23 static scoped_ptr<CCPrioritizedTexture> create(CCPrioritizedTextureManager*
manager, IntSize size, GC3Denum format) |
| 23 { | 24 { |
| 24 return adoptPtr(new CCPrioritizedTexture(manager, size, format)); | 25 return make_scoped_ptr(new CCPrioritizedTexture(manager, size, format)); |
| 25 } | 26 } |
| 26 static PassOwnPtr<CCPrioritizedTexture> create(CCPrioritizedTextureManager*
manager) | 27 static scoped_ptr<CCPrioritizedTexture> create(CCPrioritizedTextureManager*
manager) |
| 27 { | 28 { |
| 28 return adoptPtr(new CCPrioritizedTexture(manager, IntSize(), 0)); | 29 return make_scoped_ptr(new CCPrioritizedTexture(manager, IntSize(), 0)); |
| 29 } | 30 } |
| 30 ~CCPrioritizedTexture(); | 31 ~CCPrioritizedTexture(); |
| 31 | 32 |
| 32 // Texture properties. Changing these causes the backing texture to be lost. | 33 // Texture properties. Changing these causes the backing texture to be lost. |
| 33 // Setting these to the same value is a no-op. | 34 // Setting these to the same value is a no-op. |
| 34 void setTextureManager(CCPrioritizedTextureManager*); | 35 void setTextureManager(CCPrioritizedTextureManager*); |
| 35 CCPrioritizedTextureManager* textureManager() { return m_manager; } | 36 CCPrioritizedTextureManager* textureManager() { return m_manager; } |
| 36 void setDimensions(IntSize, GC3Denum format); | 37 void setDimensions(IntSize, GC3Denum format); |
| 37 GC3Denum format() const { return m_format; } | 38 GC3Denum format() const { return m_format; } |
| 38 IntSize size() const { return m_size; } | 39 IntSize size() const { return m_size; } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 133 |
| 133 Backing* m_backing; | 134 Backing* m_backing; |
| 134 CCPrioritizedTextureManager* m_manager; | 135 CCPrioritizedTextureManager* m_manager; |
| 135 | 136 |
| 136 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); | 137 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTexture); |
| 137 }; | 138 }; |
| 138 | 139 |
| 139 } // namespace cc | 140 } // namespace cc |
| 140 | 141 |
| 141 #endif | 142 #endif |
| OLD | NEW |