| 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 size_t min_allocation_bytes; |
| 104 size_t ideal_allocation_bytes; |
| 105 |
| 106 GpuMemoryAllocationRequest() |
| 107 : min_allocation_bytes(0), |
| 108 ideal_allocation_bytes(0) { |
| 109 } |
| 110 |
| 111 GpuMemoryAllocationRequest(size_t min_bytes, size_t ideal_bytes) |
| 112 : min_allocation_bytes(min_bytes), |
| 113 ideal_allocation_bytes(ideal_bytes) { |
| 114 } |
| 115 |
| 116 bool operator==(const GpuMemoryAllocationRequest& other) const { |
| 117 return min_allocation_bytes == other.min_allocation_bytes && |
| 118 ideal_allocation_bytes == other.ideal_allocation_bytes; |
| 119 } |
| 120 bool operator!=(const GpuMemoryAllocationRequest& other) const { |
| 121 return !(*this == other); |
| 122 } |
| 123 }; |
| 124 |
| 100 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | 125 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ |
| OLD | NEW |