From cf5e989ddd7831b0d50e4b076b68ff8306b7c899 Mon Sep 17 00:00:00 2001 From: "anton@chromium.org" Date: Tue, 18 Mar 2014 22:36:55 +0000 Subject: Add --disable-low-res-tiling. Disable low res tiling to save power. Generating low resolution tiles uses about 10% of the power used by pages that have gif animations (measured on Nexus 4). These are the most common pages on which chrome consumes above baseline power. It is unclear whether low resolutions are still valuable. It is likely that having low resolution tiles is more useful on older devices. For the moment providing this as a flag, so that it is easier to investigate whether dropping low resolution tiles is reasonable. Default behavior is unchanged, low resolution tiles are enabled. BUG= Review URL: https://codereview.chromium.org/196473007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257790 0039d316-1c4b-4281-b951-d872f2087c98 --- content/renderer/gpu/render_widget_compositor.cc | 2 ++ content/renderer/render_thread_impl.cc | 6 ++++++ content/renderer/render_thread_impl.h | 3 +++ 3 files changed, 11 insertions(+) (limited to 'content/renderer') diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc index d5a258b..f059451 100644 --- a/content/renderer/gpu/render_widget_compositor.cc +++ b/content/renderer/gpu/render_widget_compositor.cc @@ -142,6 +142,8 @@ scoped_ptr RenderWidgetCompositor::Create( settings.rasterization_site = cc::LayerTreeSettings::HybridRasterization; else settings.rasterization_site = cc::LayerTreeSettings::CpuRasterization; + settings.create_low_res_tiling = + RenderThreadImpl::current()->is_low_res_tiling_enabled(); settings.calculate_top_controls_position = cmd->HasSwitch(cc::switches::kEnableTopControlsPositionCalculation); diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index ccdb4cc..a6e616f 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -445,6 +445,12 @@ void RenderThreadImpl::Init() { } } + is_low_res_tiling_enabled_ = !is_gpu_rasterization_enabled_; + if (command_line.HasSwitch(switches::kDisableLowResTiling) && + !command_line.HasSwitch(switches::kEnableLowResTiling)) { + is_low_res_tiling_enabled_ = false; + } + // Note that under Linux, the media library will normally already have // been initialized by the Zygote before this instance became a Renderer. base::FilePath media_path; diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 192cb8a8..88e0c3d 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -212,6 +212,8 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, return is_impl_side_painting_enabled_; } + bool is_low_res_tiling_enabled() const { return is_low_res_tiling_enabled_; } + bool is_lcd_text_enabled() const { return is_lcd_text_enabled_; } bool is_map_image_enabled() const { return is_map_image_enabled_; } @@ -532,6 +534,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, bool is_gpu_rasterization_enabled_; bool is_gpu_rasterization_forced_; bool is_impl_side_painting_enabled_; + bool is_low_res_tiling_enabled_; bool is_lcd_text_enabled_; bool is_map_image_enabled_; -- cgit v1.1