Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: cc/output/managed_memory_policy.h

Issue 1490513005: Add support for ManagedMemoryPolicy (de)serialization (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-settings
Patch Set: Rebase on top of origin/master Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/managed_memory_policy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CC_OUTPUT_MANAGED_MEMORY_POLICY_H_ 5 #ifndef CC_OUTPUT_MANAGED_MEMORY_POLICY_H_
6 #define CC_OUTPUT_MANAGED_MEMORY_POLICY_H_ 6 #define CC_OUTPUT_MANAGED_MEMORY_POLICY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "cc/base/cc_export.h" 9 #include "cc/base/cc_export.h"
10 #include "cc/tiles/tile_priority.h" 10 #include "cc/tiles/tile_priority.h"
11 #include "gpu/command_buffer/common/gpu_memory_allocation.h" 11 #include "gpu/command_buffer/common/gpu_memory_allocation.h"
12 12
13 namespace cc { 13 namespace cc {
14 14
15 namespace proto {
16 class ManagedMemoryPolicy;
17 } // namespace proto
18
15 struct CC_EXPORT ManagedMemoryPolicy { 19 struct CC_EXPORT ManagedMemoryPolicy {
16 static const size_t kDefaultNumResourcesLimit; 20 static const size_t kDefaultNumResourcesLimit;
17 21
18 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible); 22 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible);
19 explicit ManagedMemoryPolicy( 23 explicit ManagedMemoryPolicy(
20 const gpu::MemoryAllocation& allocation); 24 const gpu::MemoryAllocation& allocation);
21 ManagedMemoryPolicy( 25 ManagedMemoryPolicy(
22 size_t bytes_limit_when_visible, 26 size_t bytes_limit_when_visible,
23 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible, 27 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible,
24 size_t num_resources_limit); 28 size_t num_resources_limit);
25 bool operator==(const ManagedMemoryPolicy&) const; 29 bool operator==(const ManagedMemoryPolicy&) const;
26 bool operator!=(const ManagedMemoryPolicy&) const; 30 bool operator!=(const ManagedMemoryPolicy&) const;
27 31
32 void ToProtobuf(proto::ManagedMemoryPolicy* proto) const;
33 void FromProtobuf(const proto::ManagedMemoryPolicy& proto);
34
28 size_t bytes_limit_when_visible; 35 size_t bytes_limit_when_visible;
29 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible; 36 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible;
30 size_t num_resources_limit; 37 size_t num_resources_limit;
31 38
32 static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy( 39 static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy(
33 gpu::MemoryAllocation::PriorityCutoff priority_cutoff); 40 gpu::MemoryAllocation::PriorityCutoff priority_cutoff);
34 }; 41 };
35 42
36 } // namespace cc 43 } // namespace cc
37 44
38 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_ 45 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_
OLDNEW
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/output/managed_memory_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698