Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | |
| 6 #define CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 | |
| 11 // These are memory allocation limits assigned to a context. | |
| 12 // They will change over time, given memory availability, browser state, and | |
| 13 // GpuIdealMemoryAllocation values (see below). | |
|
nduca
2012/01/31 06:53:47
I think the ", and ... values " doesn't really add
mmocny
2012/01/31 18:54:57
Done.
| |
| 14 // Exceeding these limits for an unreasonable amount of time will cause kill. | |
|
nduca
2012/01/31 06:53:47
will cause the context to be lost.
mmocny
2012/01/31 18:54:57
Done.
| |
| 15 struct GpuMemoryAllocation { | |
| 16 static const int kResourceSizeForegroundTab = 100 * 1024 * 1024; | |
|
nduca
2012/01/31 06:53:47
Confused why this is in the header. I would have e
mmocny
2012/01/31 18:54:57
Done.
| |
| 17 static const int kResourceSizeBackgroundTab = 50 * 1024 * 1024; | |
| 18 static const int kResourceSizeHibernatedTab = 0; | |
| 19 | |
| 20 int gpuResourceSizeInBytes; | |
| 21 bool hasFrontbuffer; | |
| 22 bool hasBackbuffer; | |
| 23 | |
| 24 GpuMemoryAllocation() | |
| 25 : gpuResourceSizeInBytes(0) | |
| 26 , hasFrontbuffer(false) | |
| 27 , hasBackbuffer(false) { | |
| 28 } | |
| 29 | |
| 30 GpuMemoryAllocation(int gpuResourceSizeInBytes, | |
| 31 bool hasFrontbuffer, | |
| 32 bool hasBackbuffer) | |
| 33 : gpuResourceSizeInBytes(gpuResourceSizeInBytes) | |
| 34 , hasFrontbuffer(hasFrontbuffer) | |
| 35 , hasBackbuffer(hasBackbuffer) { | |
| 36 } | |
| 37 }; | |
| 38 | |
| 39 // Contexts should give ideal memory allocation hints to the GpuMemoryManager | |
|
nduca
2012/01/31 06:53:47
Do we like "ideal" or do we want to try on "goal"
mmocny
2012/01/31 18:54:57
I find goal confusing, since I think of the goal t
| |
| 40 // so that it can make better decisions on how to split resources. | |
| 41 // If memory is constrained and/or this context has lower priority than others, | |
|
nduca
2012/01/31 06:53:47
this context -> a context.
mmocny
2012/01/31 18:54:57
Done.
| |
| 42 // these requests will be overruled (see actual allocation limits above). | |
|
nduca
2012/01/31 06:53:47
these requests will be overruled -> the allocated
mmocny
2012/01/31 18:54:57
Done.
| |
| 43 struct GpuIdealMemoryAllocation { | |
| 44 }; | |
| 45 | |
| 46 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_ | |
| OLD | NEW |