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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 168053002: GPU: Adjust memory and use the soft-limit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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 | ui/gl/gl_context_android.cc » ('j') | ui/gl/gl_context_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 24519d8376957ec8f5804e516e8f11c7af59ef0a..da770954da5f57656a1b3dfd5bcc5e1312ec530d 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -262,6 +262,20 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
base::android::SysUtils::IsLowEndDevice() &&
!widget->UsingSynchronousRendererCompositor() &&
!cmd->HasSwitch(cc::switches::kDisable4444Textures);
+ if (widget->UsingSynchronousRendererCompositor()) {
+ // TODO(boliu): Set this ratio for Webview.
aelias_OOO_until_Jul13 2014/02/15 00:55:17 How about just using the same policy for WebView u
epenner 2014/02/15 01:02:27 I think their limits are not as excessive as ours.
+ } else if (base::android::SysUtils::IsLowEndDevice()) {
+ // On low-end we want to be very carefull about killing other
+ // apps. So initially we use 50% more memory to avoid flickering
+ // or raster-on-demand.
+ settings.max_memory_for_prepaint_percentage = 67;
+ } else {
+ // On other devices we have increased memory excessively to avoid
+ // raster-on-demand already, so now we reserve 50% _only_ to avoid
+ // raster-on-demand, and use 50% of the memory otherwise.
+ settings.max_memory_for_prepaint_percentage = 50;
+ }
+
#elif !defined(OS_MACOSX)
if (IsOverlayScrollbarEnabled()) {
settings.scrollbar_animator = cc::LayerTreeSettings::Thinning;
« no previous file with comments | « no previous file | ui/gl/gl_context_android.cc » ('j') | ui/gl/gl_context_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698