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

Unified Diff: content/common/gpu/gpu_memory_manager.cc

Issue 22923016: Minimize GPU memory usage on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_memory_manager.cc
diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc
index 21d51630c31be7e3cb8ed5559928bfd520d51338..ccfe609bc621e4bc9a9dc6440c51459e20fa4554 100644
--- a/content/common/gpu/gpu_memory_manager.cc
+++ b/content/common/gpu/gpu_memory_manager.cc
@@ -79,8 +79,12 @@ GpuMemoryManager::GpuMemoryManager(
#endif
// On Android, always discard everything that is nonvisible.
- // On Mac, use as little memory as possible to avoid stability issues.
-#if defined(OS_ANDROID) || defined(OS_MACOSX)
+ // On Linux and Mac, use as little memory as possible to avoid stability
+ // issues.
+ // http://crbug.com/145600 (Linux)
+ // http://crbug.com/141377 (Mac)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
allow_nonvisible_memory_ = false;
#else
allow_nonvisible_memory_ = true;
@@ -774,11 +778,12 @@ void GpuMemoryManager::AssignSurfacesAllocations() {
allocation.renderer_allocation.bytes_limit_when_visible =
client_state->bytes_allocation_when_visible_;
- // Use a more conservative memory allocation policy on Mac because the
- // platform is unstable when under memory pressure.
- // http://crbug.com/141377
+ // Use a more conservative memory allocation policy on Linux and Mac
+ // because the platform is unstable when under memory pressure.
+ // http://crbug.com/145600 (Linux)
+ // http://crbug.com/141377 (Mac)
allocation.renderer_allocation.priority_cutoff_when_visible =
-#if defined(OS_MACOSX)
+#if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
GpuMemoryAllocationForRenderer::kPriorityCutoffAllowNiceToHave;
#else
GpuMemoryAllocationForRenderer::kPriorityCutoffAllowEverything;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698