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.
5 #ifndef CC_MANAGED_MEMORY_POLICY_H_
6 #define CC_MANAGED_MEMORY_POLICY_H_
8 #include "base/basictypes.h"
9 #include "cc/cc_export.h"
10 #include "cc/tile_priority.h"
14 struct CC_EXPORT ManagedMemoryPolicy
{
17 CUTOFF_ALLOW_REQUIRED_ONLY
,
18 CUTOFF_ALLOW_NICE_TO_HAVE
,
19 CUTOFF_ALLOW_EVERYTHING
,
22 ManagedMemoryPolicy(size_t bytesLimitWhenVisible
);
23 ManagedMemoryPolicy(size_t bytesLimitWhenVisible
,
24 PriorityCutoff priorityCutoffWhenVisible
,
25 size_t bytesLimitWhenNotVisible
,
26 PriorityCutoff priorityCutoffWhenNotVisible
);
27 bool operator==(const ManagedMemoryPolicy
&) const;
28 bool operator!=(const ManagedMemoryPolicy
&) const;
30 size_t bytesLimitWhenVisible
;
31 PriorityCutoff priorityCutoffWhenVisible
;
32 size_t bytesLimitWhenNotVisible
;
33 PriorityCutoff priorityCutoffWhenNotVisible
;
35 static int priorityCutoffToValue(PriorityCutoff priorityCutoff
);
36 static TileMemoryLimitPolicy
priorityCutoffToTileMemoryLimitPolicy(PriorityCutoff priorityCutoff
);
41 #endif // CC_MANAGED_MEMORY_POLICY_H_