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 "cc/prioritized_texture_manager.h" | 7 #include "cc/prioritized_texture_manager.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 texture->setAbovePriorityCutoff(false); | 387 texture->setAbovePriorityCutoff(false); |
388 } | 388 } |
389 | 389 |
390 void PrioritizedTextureManager::returnBackingTexture(PrioritizedTexture* texture
) | 390 void PrioritizedTextureManager::returnBackingTexture(PrioritizedTexture* texture
) |
391 { | 391 { |
392 DCHECK(Proxy::isMainThread() || (Proxy::isImplThread() && Proxy::isMainThrea
dBlocked())); | 392 DCHECK(Proxy::isMainThread() || (Proxy::isImplThread() && Proxy::isMainThrea
dBlocked())); |
393 if (texture->backing()) | 393 if (texture->backing()) |
394 texture->unlink(); | 394 texture->unlink(); |
395 } | 395 } |
396 | 396 |
397 PrioritizedTexture::Backing* PrioritizedTextureManager::createBacking(IntSize si
ze, GLenum format, ResourceProvider* resourceProvider) | 397 PrioritizedTexture::Backing* PrioritizedTextureManager::createBacking(gfx::Size
size, GLenum format, ResourceProvider* resourceProvider) |
398 { | 398 { |
399 DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked()); | 399 DCHECK(Proxy::isImplThread() && Proxy::isMainThreadBlocked()); |
400 DCHECK(resourceProvider); | 400 DCHECK(resourceProvider); |
401 ResourceProvider::ResourceId resourceId = resourceProvider->createResource(m
_pool, size, format, ResourceProvider::TextureUsageAny); | 401 ResourceProvider::ResourceId resourceId = resourceProvider->createResource(m
_pool, size, format, ResourceProvider::TextureUsageAny); |
402 PrioritizedTexture::Backing* backing = new PrioritizedTexture::Backing(resou
rceId, resourceProvider, size, format); | 402 PrioritizedTexture::Backing* backing = new PrioritizedTexture::Backing(resou
rceId, resourceProvider, size, format); |
403 m_memoryUseBytes += backing->bytes(); | 403 m_memoryUseBytes += backing->bytes(); |
404 return backing; | 404 return backing; |
405 } | 405 } |
406 | 406 |
407 void PrioritizedTextureManager::evictFirstBackingResource(ResourceProvider* reso
urceProvider) | 407 void PrioritizedTextureManager::evictFirstBackingResource(ResourceProvider* reso
urceProvider) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 if (reachedUnrecyclable) | 466 if (reachedUnrecyclable) |
467 DCHECK(!backing->canBeRecycled()); | 467 DCHECK(!backing->canBeRecycled()); |
468 else | 468 else |
469 DCHECK(backing->canBeRecycled()); | 469 DCHECK(backing->canBeRecycled()); |
470 previous_backing = backing; | 470 previous_backing = backing; |
471 } | 471 } |
472 #endif | 472 #endif |
473 } | 473 } |
474 | 474 |
475 } // namespace cc | 475 } // namespace cc |
OLD | NEW |