blob: dd8ac255ad710b8749cb215c0c038bbd42210253 [file] [log] [blame]
[email protected]a0a00842012-10-22 22:50:281// 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]e12dd0e2013-03-18 08:24:405#ifndef CC_RESOURCES_MANAGED_MEMORY_POLICY_H_
6#define CC_RESOURCES_MANAGED_MEMORY_POLICY_H_
[email protected]a0a00842012-10-22 22:50:287
8#include "base/basictypes.h"
[email protected]681ccff2013-03-18 06:13:529#include "cc/base/cc_export.h"
[email protected]e12dd0e2013-03-18 08:24:4010#include "cc/resources/tile_priority.h"
[email protected]a0a00842012-10-22 22:50:2811
12namespace cc {
13
[email protected]52347c842012-11-02 21:06:2014struct CC_EXPORT ManagedMemoryPolicy {
[email protected]46b8acc2013-03-19 22:38:3515 enum PriorityCutoff {
16 CUTOFF_ALLOW_NOTHING,
17 CUTOFF_ALLOW_REQUIRED_ONLY,
18 CUTOFF_ALLOW_NICE_TO_HAVE,
19 CUTOFF_ALLOW_EVERYTHING,
20 };
[email protected]9b0b79a02013-01-02 22:47:2721
[email protected]adb08542013-03-26 18:06:1022 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible);
[email protected]46b8acc2013-03-19 22:38:3523 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]a0a00842012-10-22 22:50:2829
[email protected]46b8acc2013-03-19 22:38:3530 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]9b0b79a02013-01-02 22:47:2734
[email protected]46b8acc2013-03-19 22:38:3535 static int PriorityCutoffToValue(PriorityCutoff priority_cutoff);
36 static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy(
37 PriorityCutoff priority_cutoff);
[email protected]a0a00842012-10-22 22:50:2838};
39
40} // namespace cc
41
[email protected]e12dd0e2013-03-18 08:24:4042#endif // CC_RESOURCES_MANAGED_MEMORY_POLICY_H_