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

Side by Side Diff: content/common/gpu/gpu_memory_allocation.h

Issue 10801014: Add GetStubStats and related functions in GpuMemoryManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Diff from master instead of local branch Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
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
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),
piman 2012/07/18 19:59:58 nit: extra 2 spaces indent.
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_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/gpu_memory_manager.h » ('j') | content/common/gpu/gpu_memory_manager.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698