Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #ifndef CC_MANAGED_MEMORY_POLICY_H_ | 5 #ifndef CC_MANAGED_MEMORY_POLICY_H_ |
| 6 #define CC_MANAGED_MEMORY_POLICY_H_ | 6 #define CC_MANAGED_MEMORY_POLICY_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "cc/cc_export.h" | 9 #include "cc/cc_export.h" |
| 10 #include "cc/priority_calculator.h" | |
| 11 #include "cc/tile_priority.h" | |
| 10 | 12 |
| 11 namespace cc { | 13 namespace cc { |
| 12 | 14 |
| 13 struct CC_EXPORT ManagedMemoryPolicy { | 15 struct CC_EXPORT ManagedMemoryPolicy { |
| 16 enum PriorityCutoff { | |
|
nduca
2012/12/19 21:46:32
Can we use one enum everywhere? Maybe we should ma
| |
| 17 CUTOFF_ALLOW_NOTHING, | |
| 18 CUTOFF_ALLOW_REQUIRED_ONLY, | |
| 19 CUTOFF_ALLOW_NICE_TO_HAVE, | |
| 20 CUTOFF_ALLOW_EVERYTHING, | |
| 21 }; | |
| 22 | |
| 14 ManagedMemoryPolicy(size_t bytesLimitWhenVisible); | 23 ManagedMemoryPolicy(size_t bytesLimitWhenVisible); |
| 15 ManagedMemoryPolicy(size_t bytesLimitWhenVisible, | 24 ManagedMemoryPolicy(size_t bytesLimitWhenVisible, |
| 16 int priorityCutoffWhenVisible, | 25 PriorityCutoff priorityCutoffWhenVisible, |
| 17 size_t bytesLimitWhenNotVisible, | 26 size_t bytesLimitWhenNotVisible, |
| 18 int priorityCutoffWhenNotVisible); | 27 PriorityCutoff priorityCutoffWhenNotVisible); |
| 19 bool operator==(const ManagedMemoryPolicy&) const; | 28 bool operator==(const ManagedMemoryPolicy&) const; |
| 20 bool operator!=(const ManagedMemoryPolicy&) const; | 29 bool operator!=(const ManagedMemoryPolicy&) const; |
| 21 | 30 |
| 22 size_t bytesLimitWhenVisible; | 31 size_t bytesLimitWhenVisible; |
| 23 int priorityCutoffWhenVisible; | 32 PriorityCutoff priorityCutoffWhenVisible; |
| 24 size_t bytesLimitWhenNotVisible; | 33 size_t bytesLimitWhenNotVisible; |
| 25 int priorityCutoffWhenNotVisible; | 34 PriorityCutoff priorityCutoffWhenNotVisible; |
| 35 | |
| 36 // Convert a PriorityCutoff to a priority cutoff for the prioritized resourc e manager | |
| 37 static int priorityCutoffValue(PriorityCutoff priorityCutoff); | |
| 38 | |
| 39 // Convert a PriorityCutoff to a memory limit policy limit for the tile mana ger | |
| 40 static TileMemoryLimitPolicy priorityCutoffToMemoryLimitPolicy(PriorityCutof f priorityCutoff); | |
| 26 }; | 41 }; |
| 27 | 42 |
| 28 } // namespace cc | 43 } // namespace cc |
| 29 | 44 |
| 30 #endif // CC_MANAGED_MEMORY_POLICY_H_ | 45 #endif // CC_MANAGED_MEMORY_POLICY_H_ |
| OLD | NEW |