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" |
11 #include "cc/resources/prioritized_resource.h" | 11 #include "cc/resources/prioritized_resource.h" |
12 #include "cc/resources/priority_calculator.h" | 12 #include "cc/resources/priority_calculator.h" |
13 #include "cc/trees/proxy.h" | 13 #include "cc/trees/proxy.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 PrioritizedResourceManager::PrioritizedResourceManager(const Proxy* proxy) | 17 PrioritizedResourceManager::PrioritizedResourceManager(const Proxy* proxy) |
18 : max_memory_limit_bytes_(DefaultMemoryAllocationLimit()), | 18 : proxy_(proxy), |
| 19 max_memory_limit_bytes_(DefaultMemoryAllocationLimit()), |
19 external_priority_cutoff_(PriorityCalculator::AllowEverythingCutoff()), | 20 external_priority_cutoff_(PriorityCalculator::AllowEverythingCutoff()), |
20 memory_use_bytes_(0), | 21 memory_use_bytes_(0), |
| 22 max_memory_needed_bytes_(0), |
21 memory_above_cutoff_bytes_(0), | 23 memory_above_cutoff_bytes_(0), |
22 max_memory_needed_bytes_(0), | |
23 memory_available_bytes_(0), | 24 memory_available_bytes_(0), |
24 proxy_(proxy), | |
25 backings_tail_not_sorted_(false), | 25 backings_tail_not_sorted_(false), |
26 memory_visible_bytes_(0), | 26 memory_visible_bytes_(0), |
27 memory_visible_and_nearby_bytes_(0), | 27 memory_visible_and_nearby_bytes_(0), |
28 memory_visible_last_pushed_bytes_(0), | 28 memory_visible_last_pushed_bytes_(0), |
29 memory_visible_and_nearby_last_pushed_bytes_(0) {} | 29 memory_visible_and_nearby_last_pushed_bytes_(0) {} |
30 | 30 |
31 PrioritizedResourceManager::~PrioritizedResourceManager() { | 31 PrioritizedResourceManager::~PrioritizedResourceManager() { |
32 while (textures_.size() > 0) | 32 while (textures_.size() > 0) |
33 UnregisterTexture(*textures_.begin()); | 33 UnregisterTexture(*textures_.begin()); |
34 | 34 |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 previous_backing = backing; | 539 previous_backing = backing; |
540 } | 540 } |
541 #endif | 541 #endif |
542 } | 542 } |
543 | 543 |
544 const Proxy* PrioritizedResourceManager::ProxyForDebug() const { | 544 const Proxy* PrioritizedResourceManager::ProxyForDebug() const { |
545 return proxy_; | 545 return proxy_; |
546 } | 546 } |
547 | 547 |
548 } // namespace cc | 548 } // namespace cc |
OLD | NEW |