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 GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ | 5 #ifndef GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ |
6 #define GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ | 6 #define GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 | 9 |
10 namespace gpu { | 10 namespace gpu { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 priority_cutoff_when_visible(CUTOFF_ALLOW_EVERYTHING) { | 42 priority_cutoff_when_visible(CUTOFF_ALLOW_EVERYTHING) { |
43 } | 43 } |
44 | 44 |
45 bool Equals(const MemoryAllocation& other) const { | 45 bool Equals(const MemoryAllocation& other) const { |
46 return bytes_limit_when_visible == | 46 return bytes_limit_when_visible == |
47 other.bytes_limit_when_visible && | 47 other.bytes_limit_when_visible && |
48 priority_cutoff_when_visible == other.priority_cutoff_when_visible; | 48 priority_cutoff_when_visible == other.priority_cutoff_when_visible; |
49 } | 49 } |
50 }; | 50 }; |
51 | 51 |
52 // Memory Allocation request which is sent by a client, to help GpuMemoryManager | |
53 // more ideally split memory allocations across clients. | |
54 struct ManagedMemoryStats { | |
55 // Bytes required for correct rendering. | |
56 uint64 bytes_required; | |
57 | |
58 // Bytes that are not strictly required for correctness, but, if allocated, | |
59 // will provide good performance. | |
60 uint64 bytes_nice_to_have; | |
61 | |
62 // The number of bytes currently allocated. | |
63 uint64 bytes_allocated; | |
64 | |
65 // Whether or not a backbuffer is currently requested (the memory usage | |
66 // of the buffer is known by the GPU process). | |
67 bool backbuffer_requested; | |
68 | |
69 ManagedMemoryStats() | |
70 : bytes_required(0), | |
71 bytes_nice_to_have(0), | |
72 bytes_allocated(0), | |
73 backbuffer_requested(false) { | |
74 } | |
75 | |
76 ManagedMemoryStats(uint64 bytes_required, | |
77 uint64 bytes_nice_to_have, | |
78 uint64 bytes_allocated, | |
79 bool backbuffer_requested) | |
80 : bytes_required(bytes_required), | |
81 bytes_nice_to_have(bytes_nice_to_have), | |
82 bytes_allocated(bytes_allocated), | |
83 backbuffer_requested(backbuffer_requested) { | |
84 } | |
85 | |
86 bool Equals(const ManagedMemoryStats& other) const { | |
87 return bytes_required == other.bytes_required && | |
88 bytes_nice_to_have == other.bytes_nice_to_have && | |
89 bytes_allocated == other.bytes_allocated && | |
90 backbuffer_requested == other.backbuffer_requested; | |
91 } | |
92 }; | |
93 | |
94 } // namespace content | 52 } // namespace content |
95 | 53 |
96 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ | 54 #endif // GPU_COMMAND_BUFFER_COMMON_GPU_MEMORY_ALLOCATION_H_ |
OLD | NEW |