| 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/resources/prioritized_resource_manager.h" | 5 #include "cc/resources/prioritized_resource_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 409 |
| 410 void PrioritizedResourceManager::RegisterTexture(PrioritizedResource* texture) { | 410 void PrioritizedResourceManager::RegisterTexture(PrioritizedResource* texture) { |
| 411 DCHECK(proxy_->IsMainThread()); | 411 DCHECK(proxy_->IsMainThread()); |
| 412 DCHECK(texture); | 412 DCHECK(texture); |
| 413 DCHECK(!texture->resource_manager()); | 413 DCHECK(!texture->resource_manager()); |
| 414 DCHECK(!texture->backing()); | 414 DCHECK(!texture->backing()); |
| 415 DCHECK(!ContainsKey(textures_, texture)); | 415 DCHECK(!ContainsKey(textures_, texture)); |
| 416 | 416 |
| 417 texture->set_manager_internal(this); | 417 texture->set_manager_internal(this); |
| 418 textures_.insert(texture); | 418 textures_.insert(texture); |
| 419 | |
| 420 } | 419 } |
| 421 | 420 |
| 422 void PrioritizedResourceManager::UnregisterTexture( | 421 void PrioritizedResourceManager::UnregisterTexture( |
| 423 PrioritizedResource* texture) { | 422 PrioritizedResource* texture) { |
| 424 DCHECK(proxy_->IsMainThread() || | 423 DCHECK(proxy_->IsMainThread() || |
| 425 (proxy_->IsImplThread() && proxy_->IsMainThreadBlocked())); | 424 (proxy_->IsImplThread() && proxy_->IsMainThreadBlocked())); |
| 426 DCHECK(texture); | 425 DCHECK(texture); |
| 427 DCHECK(ContainsKey(textures_, texture)); | 426 DCHECK(ContainsKey(textures_, texture)); |
| 428 | 427 |
| 429 ReturnBackingTexture(texture); | 428 ReturnBackingTexture(texture); |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 previous_backing = backing; | 533 previous_backing = backing; |
| 535 } | 534 } |
| 536 #endif | 535 #endif |
| 537 } | 536 } |
| 538 | 537 |
| 539 const Proxy* PrioritizedResourceManager::ProxyForDebug() const { | 538 const Proxy* PrioritizedResourceManager::ProxyForDebug() const { |
| 540 return proxy_; | 539 return proxy_; |
| 541 } | 540 } |
| 542 | 541 |
| 543 } // namespace cc | 542 } // namespace cc |
| OLD | NEW |