| 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 CCPrioritizedTextureManager_h | 5 #ifndef CCPrioritizedTextureManager_h |
| 6 #define CCPrioritizedTextureManager_h | 6 #define CCPrioritizedTextureManager_h |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 9 #include "CCPrioritizedTexture.h" | 10 #include "CCPrioritizedTexture.h" |
| 10 #include "CCPriorityCalculator.h" | 11 #include "CCPriorityCalculator.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 #include <wtf/HashSet.h> | 16 #include <wtf/HashSet.h> |
| 16 #include <wtf/ListHashSet.h> | 17 #include <wtf/ListHashSet.h> |
| 17 #include <wtf/Vector.h> | 18 #include <wtf/Vector.h> |
| 18 | 19 |
| 19 namespace cc { | 20 namespace cc { |
| 20 | 21 |
| 21 class CCPrioritizedTexture; | 22 class CCPrioritizedTexture; |
| 22 class CCPriorityCalculator; | 23 class CCPriorityCalculator; |
| 23 | 24 |
| 24 class CCPrioritizedTextureManager { | 25 class CCPrioritizedTextureManager { |
| 25 public: | 26 public: |
| 26 static PassOwnPtr<CCPrioritizedTextureManager> create(size_t maxMemoryLimitB
ytes, int maxTextureSize, int pool) | 27 static scoped_ptr<CCPrioritizedTextureManager> create(size_t maxMemoryLimitB
ytes, int maxTextureSize, int pool) |
| 27 { | 28 { |
| 28 return adoptPtr(new CCPrioritizedTextureManager(maxMemoryLimitBytes, max
TextureSize, pool)); | 29 return make_scoped_ptr(new CCPrioritizedTextureManager(maxMemoryLimitByt
es, maxTextureSize, pool)); |
| 29 } | 30 } |
| 30 PassOwnPtr<CCPrioritizedTexture> createTexture(IntSize size, GC3Denum format
) | 31 scoped_ptr<CCPrioritizedTexture> createTexture(IntSize size, GC3Denum format
) |
| 31 { | 32 { |
| 32 return adoptPtr(new CCPrioritizedTexture(this, size, format)); | 33 return make_scoped_ptr(new CCPrioritizedTexture(this, size, format)); |
| 33 } | 34 } |
| 34 ~CCPrioritizedTextureManager(); | 35 ~CCPrioritizedTextureManager(); |
| 35 | 36 |
| 36 typedef Vector<CCPrioritizedTexture::Backing*> BackingVector; | 37 typedef Vector<CCPrioritizedTexture::Backing*> BackingVector; |
| 37 | 38 |
| 38 // FIXME (http://crbug.com/137094): This 64MB default is a straggler from th
e | 39 // FIXME (http://crbug.com/137094): This 64MB default is a straggler from th
e |
| 39 // old texture manager and is just to give us a default memory allocation be
fore | 40 // old texture manager and is just to give us a default memory allocation be
fore |
| 40 // we get a callback from the GPU memory manager. We should probaby either: | 41 // we get a callback from the GPU memory manager. We should probaby either: |
| 41 // - wait for the callback before rendering anything instead | 42 // - wait for the callback before rendering anything instead |
| 42 // - push this into the GPU memory manager somehow. | 43 // - push this into the GPU memory manager somehow. |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // Set by the main thread when it adjust priorities in such a way that | 140 // Set by the main thread when it adjust priorities in such a way that |
| 140 // the m_backings array's view of priorities is now out of date. | 141 // the m_backings array's view of priorities is now out of date. |
| 141 bool m_needsUpdateBackingsPrioritites; | 142 bool m_needsUpdateBackingsPrioritites; |
| 142 | 143 |
| 143 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager); | 144 DISALLOW_COPY_AND_ASSIGN(CCPrioritizedTextureManager); |
| 144 }; | 145 }; |
| 145 | 146 |
| 146 } // namespace cc | 147 } // namespace cc |
| 147 | 148 |
| 148 #endif | 149 #endif |
| OLD | NEW |