| 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 "cc/prioritized_resource_manager.h" | 5 #include "cc/prioritized_resource_manager.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "cc/prioritized_resource.h" | 9 #include "cc/prioritized_resource.h" |
| 10 #include "cc/priority_calculator.h" | 10 #include "cc/priority_calculator.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 { | 388 { |
| 389 DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMai
nThreadBlocked())); | 389 DCHECK(m_proxy->isMainThread() || (m_proxy->isImplThread() && m_proxy->isMai
nThreadBlocked())); |
| 390 if (texture->backing()) | 390 if (texture->backing()) |
| 391 texture->unlink(); | 391 texture->unlink(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Siz
e size, GLenum format, ResourceProvider* resourceProvider) | 394 PrioritizedResource::Backing* PrioritizedResourceManager::createBacking(gfx::Siz
e size, GLenum format, ResourceProvider* resourceProvider) |
| 395 { | 395 { |
| 396 DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); | 396 DCHECK(m_proxy->isImplThread() && m_proxy->isMainThreadBlocked()); |
| 397 DCHECK(resourceProvider); | 397 DCHECK(resourceProvider); |
| 398 ResourceProvider::ResourceId resourceId = resourceProvider->createManagedRes
ource(size, format, ResourceProvider::TextureUsageAny); | 398 ResourceProvider::ResourceId resourceId = resourceProvider->createAllocatedM
anagedResource(size, format, ResourceProvider::TextureUsageAny); |
| 399 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(res
ourceId, resourceProvider, size, format); | 399 PrioritizedResource::Backing* backing = new PrioritizedResource::Backing(res
ourceId, resourceProvider, size, format); |
| 400 m_memoryUseBytes += backing->bytes(); | 400 m_memoryUseBytes += backing->bytes(); |
| 401 return backing; | 401 return backing; |
| 402 } | 402 } |
| 403 | 403 |
| 404 void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* res
ourceProvider) | 404 void PrioritizedResourceManager::evictFirstBackingResource(ResourceProvider* res
ourceProvider) |
| 405 { | 405 { |
| 406 DCHECK(m_proxy->isImplThread()); | 406 DCHECK(m_proxy->isImplThread()); |
| 407 DCHECK(resourceProvider); | 407 DCHECK(resourceProvider); |
| 408 DCHECK(!m_backings.empty()); | 408 DCHECK(!m_backings.empty()); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 } | 470 } |
| 471 #endif | 471 #endif |
| 472 } | 472 } |
| 473 | 473 |
| 474 const Proxy* PrioritizedResourceManager::proxyForDebug() const | 474 const Proxy* PrioritizedResourceManager::proxyForDebug() const |
| 475 { | 475 { |
| 476 return m_proxy; | 476 return m_proxy; |
| 477 } | 477 } |
| 478 | 478 |
| 479 } // namespace cc | 479 } // namespace cc |
| OLD | NEW |