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 "CCPrioritizedTextureManager.h" | 7 #include "CCPrioritizedTextureManager.h" |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "CCPrioritizedTexture.h" | 10 #include "CCPrioritizedTexture.h" |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 texture->setAbovePriorityCutoff(false); | 343 texture->setAbovePriorityCutoff(false); |
344 } | 344 } |
345 | 345 |
346 void CCPrioritizedTextureManager::returnBackingTexture(CCPrioritizedTexture* tex
ture) | 346 void CCPrioritizedTextureManager::returnBackingTexture(CCPrioritizedTexture* tex
ture) |
347 { | 347 { |
348 ASSERT(CCProxy::isMainThread() || (CCProxy::isImplThread() && CCProxy::isMai
nThreadBlocked())); | 348 ASSERT(CCProxy::isMainThread() || (CCProxy::isImplThread() && CCProxy::isMai
nThreadBlocked())); |
349 if (texture->backing()) | 349 if (texture->backing()) |
350 texture->unlink(); | 350 texture->unlink(); |
351 } | 351 } |
352 | 352 |
353 CCPrioritizedTexture::Backing* CCPrioritizedTextureManager::createBacking(IntSiz
e size, GC3Denum format, CCResourceProvider* resourceProvider) | 353 CCPrioritizedTexture::Backing* CCPrioritizedTextureManager::createBacking(IntSiz
e size, GLenum format, CCResourceProvider* resourceProvider) |
354 { | 354 { |
355 ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); | 355 ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); |
356 ASSERT(resourceProvider); | 356 ASSERT(resourceProvider); |
357 CCResourceProvider::ResourceId resourceId = resourceProvider->createResource
(m_pool, size, format, CCResourceProvider::TextureUsageAny); | 357 CCResourceProvider::ResourceId resourceId = resourceProvider->createResource
(m_pool, size, format, CCResourceProvider::TextureUsageAny); |
358 CCPrioritizedTexture::Backing* backing = new CCPrioritizedTexture::Backing(r
esourceId, resourceProvider, size, format); | 358 CCPrioritizedTexture::Backing* backing = new CCPrioritizedTexture::Backing(r
esourceId, resourceProvider, size, format); |
359 m_memoryUseBytes += backing->bytes(); | 359 m_memoryUseBytes += backing->bytes(); |
360 // Put backing texture at the front for eviction, since it isn't in use yet. | 360 // Put backing texture at the front for eviction, since it isn't in use yet. |
361 m_backings.insertBefore(m_backings.begin(), backing); | 361 m_backings.insertBefore(m_backings.begin(), backing); |
362 return backing; | 362 return backing; |
363 } | 363 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 if (reachedUnrecyclable) | 420 if (reachedUnrecyclable) |
421 ASSERT(!(*it)->canBeRecycled()); | 421 ASSERT(!(*it)->canBeRecycled()); |
422 else | 422 else |
423 ASSERT((*it)->canBeRecycled()); | 423 ASSERT((*it)->canBeRecycled()); |
424 } | 424 } |
425 } | 425 } |
426 #endif | 426 #endif |
427 | 427 |
428 | 428 |
429 } // namespace cc | 429 } // namespace cc |
OLD | NEW |