Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 | 9 |
| 10 // These are per context memory allocation limits set by the GpuMemoryManager | 10 // These are per context memory allocation limits set by the GpuMemoryManager |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 return static_cast<const GpuMemoryAllocationForRenderer&>(*this) == | 90 return static_cast<const GpuMemoryAllocationForRenderer&>(*this) == |
| 91 static_cast<const GpuMemoryAllocationForRenderer&>(other) && | 91 static_cast<const GpuMemoryAllocationForRenderer&>(other) && |
| 92 static_cast<const GpuMemoryAllocationForBrowser&>(*this) == | 92 static_cast<const GpuMemoryAllocationForBrowser&>(*this) == |
| 93 static_cast<const GpuMemoryAllocationForBrowser&>(other); | 93 static_cast<const GpuMemoryAllocationForBrowser&>(other); |
| 94 } | 94 } |
| 95 bool operator!=(const GpuMemoryAllocation& other) const { | 95 bool operator!=(const GpuMemoryAllocation& other) const { |
| 96 return !(*this == other); | 96 return !(*this == other); |
| 97 } | 97 } |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // Memory Allocation request which is sent by a client, to help GpuMemoryManager | |
| 101 // more ideally split memory allocations across clients. | |
| 102 struct GpuMemoryAllocationRequest | |
| 103 { | |
|
piman
2012/07/18 17:11:25
nit: { on previous line
| |
| 104 size_t min_allocation_bytes; | |
| 105 size_t ideal_allocation_bytes; | |
| 106 | |
| 107 GpuMemoryAllocationRequest() | |
| 108 : min_allocation_bytes(0), ideal_allocation_bytes(0) | |
|
piman
2012/07/18 17:11:25
nit: indent (+4 before :), style (ideal_allocation
| |
| 109 { | |
| 110 } | |
| 111 | |
| 112 GpuMemoryAllocationRequest(size_t min_bytes, size_t ideal_bytes) | |
| 113 : min_allocation_bytes(min_bytes), ideal_allocation_bytes(ideal_bytes) | |
| 114 { | |
| 115 } | |
| 116 | |
| 117 bool operator==(const GpuMemoryAllocationRequest& other) const { | |
| 118 return min_allocation_bytes == other.min_allocation_bytes && | |
|
piman
2012/07/18 17:11:25
nit: indent (+2)
| |
| 119 ideal_allocation_bytes == other.ideal_allocation_bytes; | |
|
piman
2012/07/18 17:11:25
nit: indent (+4 for continuations)
| |
| 120 } | |
| 121 bool operator!=(const GpuMemoryAllocationRequest& other) const { | |
| 122 return !(*this == other); | |
| 123 } | |
| 124 }; | |
| 125 | |
| 100 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | 126 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ |
| OLD | NEW |