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

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

Issue 780413003: Disable GPU rasterization on low-end devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: is_low_end_device -> use_low_memory_policy Created 6 years 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/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 f4188f8ab9eff5a28befdb4a83a8acbe46dad443..f373f3dae86f9e7023b65c8fa6517eb864080656 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -330,6 +330,10 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
SynchronousCompositorFactory* synchronous_compositor_factory =
SynchronousCompositorFactory::GetInstance();
+ // We can't use GPU rasterization on low-end devices, because the Ganesh
+ // cache would consume too much memory.
+ if (base::SysInfo::IsLowEndDevice())
+ settings.gpu_rasterization_enabled = false;
settings.using_synchronous_renderer_compositor =
synchronous_compositor_factory;
settings.record_full_layer = widget->DoesRecordFullLayer();
@@ -353,12 +357,12 @@ scoped_ptr<RenderWidgetCompositor> RenderWidgetCompositor::Create(
synchronous_compositor_factory;
// Memory policy on Android WebView does not depend on whether device is
// low end, so always use default policy.
- bool is_low_end_device =
+ bool use_low_memory_policy =
base::SysInfo::IsLowEndDevice() && !synchronous_compositor_factory;
// RGBA_4444 textures are only enabled for low end devices
// and are disabled for Android WebView as it doesn't support the format.
- settings.renderer_settings.use_rgba_4444_textures = is_low_end_device;
- if (is_low_end_device) {
+ settings.renderer_settings.use_rgba_4444_textures = use_low_memory_policy;
+ if (use_low_memory_policy) {
// 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.
« 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