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

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

Issue 9289052: Adding GpuMemoryManager to track GpuCommandBufferStub visibility and last_used_time and dictate mem… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor updates, working on tests Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
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
new file mode 100644
index 0000000000000000000000000000000000000000..c11fdd3ab4b6727305bc0bce829523309359cfc6
--- /dev/null
+++ b/content/common/gpu/gpu_memory_allocation.h
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_
+#define CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_
+#pragma once
+
+#include "base/basictypes.h"
+
+// These are memory allocation limits assigned to a context.
+// They will change over time, given memory availability, browser state, and
+// 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.
+// 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.
+struct GpuMemoryAllocation {
+ 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.
+ static const int kResourceSizeBackgroundTab = 50 * 1024 * 1024;
+ static const int kResourceSizeHibernatedTab = 0;
+
+ int gpuResourceSizeInBytes;
+ bool hasFrontbuffer;
+ bool hasBackbuffer;
+
+ GpuMemoryAllocation()
+ : gpuResourceSizeInBytes(0)
+ , hasFrontbuffer(false)
+ , hasBackbuffer(false) {
+ }
+
+ GpuMemoryAllocation(int gpuResourceSizeInBytes,
+ bool hasFrontbuffer,
+ bool hasBackbuffer)
+ : gpuResourceSizeInBytes(gpuResourceSizeInBytes)
+ , hasFrontbuffer(hasFrontbuffer)
+ , hasBackbuffer(hasBackbuffer) {
+ }
+};
+
+// 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
+// so that it can make better decisions on how to split resources.
+// 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.
+// 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.
+struct GpuIdealMemoryAllocation {
+};
+
+#endif // CONTENT_COMMON_GPU_GPU_MEMORY_ALLOCATION_H_

Powered by Google App Engine
This is Rietveld 408576698