[email protected] | a0a0084 | 2012-10-22 22:50:28 | [diff] [blame] | 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 | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | e12dd0e | 2013-03-18 08:24:40 | [diff] [blame] | 5 | #ifndef CC_RESOURCES_MANAGED_MEMORY_POLICY_H_ |
6 | #define CC_RESOURCES_MANAGED_MEMORY_POLICY_H_ | ||||
[email protected] | a0a0084 | 2012-10-22 22:50:28 | [diff] [blame] | 7 | |
8 | #include "base/basictypes.h" | ||||
[email protected] | 681ccff | 2013-03-18 06:13:52 | [diff] [blame] | 9 | #include "cc/base/cc_export.h" |
[email protected] | e12dd0e | 2013-03-18 08:24:40 | [diff] [blame] | 10 | #include "cc/resources/tile_priority.h" |
[email protected] | a0a0084 | 2012-10-22 22:50:28 | [diff] [blame] | 11 | |
12 | namespace cc { | ||||
13 | |||||
[email protected] | 52347c84 | 2012-11-02 21:06:20 | [diff] [blame] | 14 | struct CC_EXPORT ManagedMemoryPolicy { |
[email protected] | 46b8acc | 2013-03-19 22:38:35 | [diff] [blame^] | 15 | enum PriorityCutoff { |
16 | CUTOFF_ALLOW_NOTHING, | ||||
17 | CUTOFF_ALLOW_REQUIRED_ONLY, | ||||
18 | CUTOFF_ALLOW_NICE_TO_HAVE, | ||||
19 | CUTOFF_ALLOW_EVERYTHING, | ||||
20 | }; | ||||
[email protected] | 9b0b79a0 | 2013-01-02 22:47:27 | [diff] [blame] | 21 | |
[email protected] | 46b8acc | 2013-03-19 22:38:35 | [diff] [blame^] | 22 | ManagedMemoryPolicy(size_t bytes_limit_when_visible); |
23 | ManagedMemoryPolicy(size_t bytes_limit_when_visible, | ||||
24 | PriorityCutoff priority_cutoff_when_visible, | ||||
25 | size_t bytes_limit_when_not_visible, | ||||
26 | PriorityCutoff priority_cutoff_when_not_visible); | ||||
27 | bool operator==(const ManagedMemoryPolicy&) const; | ||||
28 | bool operator!=(const ManagedMemoryPolicy&) const; | ||||
[email protected] | a0a0084 | 2012-10-22 22:50:28 | [diff] [blame] | 29 | |
[email protected] | 46b8acc | 2013-03-19 22:38:35 | [diff] [blame^] | 30 | size_t bytes_limit_when_visible; |
31 | PriorityCutoff priority_cutoff_when_visible; | ||||
32 | size_t bytes_limit_when_not_visible; | ||||
33 | PriorityCutoff priority_cutoff_when_not_visible; | ||||
[email protected] | 9b0b79a0 | 2013-01-02 22:47:27 | [diff] [blame] | 34 | |
[email protected] | 46b8acc | 2013-03-19 22:38:35 | [diff] [blame^] | 35 | static int PriorityCutoffToValue(PriorityCutoff priority_cutoff); |
36 | static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy( | ||||
37 | PriorityCutoff priority_cutoff); | ||||
[email protected] | a0a0084 | 2012-10-22 22:50:28 | [diff] [blame] | 38 | }; |
39 | |||||
40 | } // namespace cc | ||||
41 | |||||
[email protected] | e12dd0e | 2013-03-18 08:24:40 | [diff] [blame] | 42 | #endif // CC_RESOURCES_MANAGED_MEMORY_POLICY_H_ |