| 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCPrioritizedTexture.h" | 7 #include "CCPrioritizedTexture.h" |
| 8 | 8 |
| 9 #include "CCPrioritizedTextureManager.h" | 9 #include "CCPrioritizedTextureManager.h" |
| 10 #include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread | 10 #include "CCSingleThreadProxy.h" // For DebugScopedSetImplThread |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 textureManager->updateBackingsPriorities(); | 73 textureManager->updateBackingsPriorities(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 CCResourceProvider* resourceProvider() | 76 CCResourceProvider* resourceProvider() |
| 77 { | 77 { |
| 78 return m_resourceProvider.get(); | 78 return m_resourceProvider.get(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void textureManagerAssertInvariants(CCPrioritizedTextureManager* textureMana
ger) | 81 void textureManagerAssertInvariants(CCPrioritizedTextureManager* textureMana
ger) |
| 82 { | 82 { |
| 83 #if !ASSERT_DISABLED | |
| 84 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBloc
ked; | 83 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBloc
ked; |
| 85 textureManager->assertInvariants(); | 84 textureManager->assertInvariants(); |
| 86 #endif | |
| 87 } | 85 } |
| 88 | 86 |
| 89 bool textureBackingIsAbovePriorityCutoff(CCPrioritizedTexture* texture) | 87 bool textureBackingIsAbovePriorityCutoff(CCPrioritizedTexture* texture) |
| 90 { | 88 { |
| 91 return texture->m_backing->wasAbovePriorityCutoffAtLastPriorityUpdate(); | 89 return texture->m_backing->wasAbovePriorityCutoffAtLastPriorityUpdate(); |
| 92 } | 90 } |
| 93 | 91 |
| 94 protected: | 92 protected: |
| 95 const IntSize m_textureSize; | 93 const IntSize m_textureSize; |
| 96 const GC3Denum m_textureFormat; | 94 const GC3Denum m_textureFormat; |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 EXPECT_TRUE(textureBackingIsAbovePriorityCutoff(textures[i].get())); | 525 EXPECT_TRUE(textureBackingIsAbovePriorityCutoff(textures[i].get())); |
| 528 for (size_t i = 1; i < maxTextures; i += 2) | 526 for (size_t i = 1; i < maxTextures; i += 2) |
| 529 EXPECT_FALSE(textureBackingIsAbovePriorityCutoff(textures[i].get())); | 527 EXPECT_FALSE(textureBackingIsAbovePriorityCutoff(textures[i].get())); |
| 530 | 528 |
| 531 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; | 529 DebugScopedSetImplThreadAndMainThreadBlocked implThreadAndMainThreadBlocked; |
| 532 textureManager->clearAllMemory(resourceProvider()); | 530 textureManager->clearAllMemory(resourceProvider()); |
| 533 } | 531 } |
| 534 | 532 |
| 535 | 533 |
| 536 } // namespace | 534 } // namespace |
| OLD | NEW |