| OLD | NEW |
| 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/resources/tile_priority.h" | 10 #include "cc/resources/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 struct CC_EXPORT ManagedMemoryPolicy { | 15 struct CC_EXPORT ManagedMemoryPolicy { |
| 16 static const size_t kDefaultNumResourcesLimit; | |
| 17 | |
| 18 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible); | 16 explicit ManagedMemoryPolicy(size_t bytes_limit_when_visible); |
| 19 explicit ManagedMemoryPolicy( | 17 explicit ManagedMemoryPolicy( |
| 20 const gpu::MemoryAllocation& allocation); | 18 const gpu::MemoryAllocation& allocation); |
| 21 ManagedMemoryPolicy( | 19 ManagedMemoryPolicy( |
| 22 size_t bytes_limit_when_visible, | 20 size_t bytes_limit_when_visible, |
| 23 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible, | 21 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible); |
| 24 size_t num_resources_limit); | |
| 25 bool operator==(const ManagedMemoryPolicy&) const; | 22 bool operator==(const ManagedMemoryPolicy&) const; |
| 26 bool operator!=(const ManagedMemoryPolicy&) const; | 23 bool operator!=(const ManagedMemoryPolicy&) const; |
| 27 | 24 |
| 28 size_t bytes_limit_when_visible; | 25 size_t bytes_limit_when_visible; |
| 29 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible; | 26 gpu::MemoryAllocation::PriorityCutoff priority_cutoff_when_visible; |
| 30 size_t num_resources_limit; | |
| 31 | 27 |
| 32 static int PriorityCutoffToValue( | 28 static int PriorityCutoffToValue( |
| 33 gpu::MemoryAllocation::PriorityCutoff priority_cutoff); | 29 gpu::MemoryAllocation::PriorityCutoff priority_cutoff); |
| 34 static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy( | 30 static TileMemoryLimitPolicy PriorityCutoffToTileMemoryLimitPolicy( |
| 35 gpu::MemoryAllocation::PriorityCutoff priority_cutoff); | 31 gpu::MemoryAllocation::PriorityCutoff priority_cutoff); |
| 36 }; | 32 }; |
| 37 | 33 |
| 38 } // namespace cc | 34 } // namespace cc |
| 39 | 35 |
| 40 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_ | 36 #endif // CC_OUTPUT_MANAGED_MEMORY_POLICY_H_ |
| OLD | NEW |