1 // Copyright 2013 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_OUTPUT_MANAGED_MEMORY_POLICY_H_
6 #define CC_OUTPUT_MANAGED_MEMORY_POLICY_H_
8 #include "base/basictypes.h"
9 #include "cc/base/cc_export.h"
10 #include "cc/resources/tile_priority.h"
14 struct CC_EXPORT ManagedMemoryPolicy
{
17 CUTOFF_ALLOW_REQUIRED_ONLY
,
18 CUTOFF_ALLOW_NICE_TO_HAVE
,
19 CUTOFF_ALLOW_EVERYTHING
,
21 static const size_t kDefaultNumResourcesLimit
;
23 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible
);
24 ManagedMemoryPolicy(size_t bytes_limit_when_visible
,
25 PriorityCutoff priority_cutoff_when_visible
,
26 size_t bytes_limit_when_not_visible
,
27 PriorityCutoff priority_cutoff_when_not_visible
,
28 size_t num_resources_limit
);
29 bool operator==(const ManagedMemoryPolicy
&) const;
30 bool operator!=(const ManagedMemoryPolicy
&) const;
32 size_t bytes_limit_when_visible
;
33 PriorityCutoff priority_cutoff_when_visible
;
34 size_t bytes_limit_when_not_visible
;
35 PriorityCutoff priority_cutoff_when_not_visible
;
36 size_t num_resources_limit
;
38 static int PriorityCutoffToValue(PriorityCutoff priority_cutoff
);
39 static TileMemoryLimitPolicy
PriorityCutoffToTileMemoryLimitPolicy(
40 PriorityCutoff priority_cutoff
);
45 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_