Chromium Code Reviews

Unified Diff: content/common/gpu/gpu_memory_allocation.h

Issue 10083056: GpuMemoryManager suggests values for renderer Contents Texture Managers' preferred memory limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing issue with every proxy registering a callback, even when it is null. Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: content/common/gpu/gpu_memory_allocation.h
diff --git a/content/common/gpu/gpu_memory_allocation.h b/content/common/gpu/gpu_memory_allocation.h
index b38fe8320403a9bd8327dc659963479e7914867a..3df1c66a7757daf6b1bcc075d032e6e778c03e2c 100644
--- a/content/common/gpu/gpu_memory_allocation.h
+++ b/content/common/gpu/gpu_memory_allocation.h
@@ -12,7 +12,6 @@
// and assigned to the browser and renderer context.
// They will change over time, given memory availability, and browser state.
-
// Memory Allocation which will be assigned to the renderer context.
struct GpuMemoryAllocationForRenderer {
enum {
@@ -68,6 +67,13 @@ struct GpuMemoryAllocationForBrowser {
// GpuMemoryManager.
struct GpuMemoryAllocation : public GpuMemoryAllocationForRenderer,
public GpuMemoryAllocationForBrowser {
+ // Bitmap
+ enum BufferAllocation {
+ kHasNoBuffers = 0,
+ kHasFrontbuffer = 1,
+ kHasBackbuffer = 2
+ };
+
GpuMemoryAllocation()
: GpuMemoryAllocationForRenderer(),
GpuMemoryAllocationForBrowser() {
@@ -81,6 +87,13 @@ struct GpuMemoryAllocation : public GpuMemoryAllocationForRenderer,
GpuMemoryAllocationForBrowser(suggest_have_frontbuffer) {
}
+ GpuMemoryAllocation(size_t gpu_resource_size_in_bytes,
+ int allocationBitmap)
+ : GpuMemoryAllocationForRenderer(gpu_resource_size_in_bytes,
+ allocationBitmap & kHasBackbuffer),
+ GpuMemoryAllocationForBrowser(allocationBitmap & kHasFrontbuffer) {
+ }
+
bool operator==(const GpuMemoryAllocation& other) const {
return static_cast<const GpuMemoryAllocationForRenderer&>(*this) ==
static_cast<const GpuMemoryAllocationForRenderer&>(other) &&

Powered by Google App Engine