cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / cc / output / managed_memory_policy.h
blob5a607a7a1f22be19688d469c869a591f35139530
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"
12 namespace cc {
14 struct CC_EXPORT ManagedMemoryPolicy {
15 enum PriorityCutoff {
16 CUTOFF_ALLOW_NOTHING,
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);
43 } // namespace cc
45 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_