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

Side by Side Diff: cc/resources/tile_priority.h

Issue 140673009: CC/GPU: Add a soft limit to the compositor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 10 months 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/resources/tile_manager_unittest.cc ('k') | cc/resources/tile_priority.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_RESOURCES_TILE_PRIORITY_H_ 5 #ifndef CC_RESOURCES_TILE_PRIORITY_H_
6 #define CC_RESOURCES_TILE_PRIORITY_H_ 6 #define CC_RESOURCES_TILE_PRIORITY_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <limits> 9 #include <limits>
10 10
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 NEW_CONTENT_TAKES_PRIORITY 131 NEW_CONTENT_TAKES_PRIORITY
132 132
133 // Be sure to update TreePriorityAsValue when adding new fields. 133 // Be sure to update TreePriorityAsValue when adding new fields.
134 }; 134 };
135 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio); 135 scoped_ptr<base::Value> TreePriorityAsValue(TreePriority prio);
136 136
137 class GlobalStateThatImpactsTilePriority { 137 class GlobalStateThatImpactsTilePriority {
138 public: 138 public:
139 GlobalStateThatImpactsTilePriority() 139 GlobalStateThatImpactsTilePriority()
140 : memory_limit_policy(ALLOW_NOTHING), 140 : memory_limit_policy(ALLOW_NOTHING),
141 memory_limit_in_bytes(0), 141 soft_memory_limit_in_bytes(0),
142 hard_memory_limit_in_bytes(0),
142 unused_memory_limit_in_bytes(0), 143 unused_memory_limit_in_bytes(0),
143 num_resources_limit(0), 144 num_resources_limit(0),
144 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {} 145 tree_priority(SAME_PRIORITY_FOR_BOTH_TREES) {}
145 146
146 TileMemoryLimitPolicy memory_limit_policy; 147 TileMemoryLimitPolicy memory_limit_policy;
147 148
148 size_t memory_limit_in_bytes; 149 size_t soft_memory_limit_in_bytes;
150 size_t hard_memory_limit_in_bytes;
149 size_t unused_memory_limit_in_bytes; 151 size_t unused_memory_limit_in_bytes;
150 size_t num_resources_limit; 152 size_t num_resources_limit;
151 153
152 TreePriority tree_priority; 154 TreePriority tree_priority;
153 155
154 bool operator==(const GlobalStateThatImpactsTilePriority& other) const { 156 bool operator==(const GlobalStateThatImpactsTilePriority& other) const {
155 return memory_limit_policy == other.memory_limit_policy 157 return memory_limit_policy == other.memory_limit_policy &&
156 && memory_limit_in_bytes == other.memory_limit_in_bytes 158 soft_memory_limit_in_bytes == other.soft_memory_limit_in_bytes &&
157 && unused_memory_limit_in_bytes == other.unused_memory_limit_in_bytes 159 hard_memory_limit_in_bytes == other.hard_memory_limit_in_bytes &&
158 && num_resources_limit == other.num_resources_limit 160 unused_memory_limit_in_bytes == other.unused_memory_limit_in_bytes &&
159 && tree_priority == other.tree_priority; 161 num_resources_limit == other.num_resources_limit &&
162 tree_priority == other.tree_priority;
160 } 163 }
161 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const { 164 bool operator!=(const GlobalStateThatImpactsTilePriority& other) const {
162 return !(*this == other); 165 return !(*this == other);
163 } 166 }
164 167
165 scoped_ptr<base::Value> AsValue() const; 168 scoped_ptr<base::Value> AsValue() const;
166 }; 169 };
167 170
168 } // namespace cc 171 } // namespace cc
169 172
170 #endif // CC_RESOURCES_TILE_PRIORITY_H_ 173 #endif // CC_RESOURCES_TILE_PRIORITY_H_
OLDNEW
« no previous file with comments | « cc/resources/tile_manager_unittest.cc ('k') | cc/resources/tile_priority.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698