diff options
author | anton@chromium.org <anton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 22:36:55 +0000 |
---|---|---|
committer | anton@chromium.org <anton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-18 22:36:55 +0000 |
commit | cf5e989ddd7831b0d50e4b076b68ff8306b7c899 (patch) | |
tree | 432af06fb8ea25c2926e7905aef65bc6e5a5d3a5 /cc | |
parent | 421c150eb78989b877aa621359a7af43a548c49d (diff) | |
download | chromium_src-cf5e989ddd7831b0d50e4b076b68ff8306b7c899.zip chromium_src-cf5e989ddd7831b0d50e4b076b68ff8306b7c899.tar.gz chromium_src-cf5e989ddd7831b0d50e4b076b68ff8306b7c899.tar.bz2 |
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
Diffstat (limited to 'cc')
-rw-r--r-- | cc/layers/picture_layer_impl.cc | 5 | ||||
-rw-r--r-- | cc/layers/picture_layer_impl.h | 3 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.cc | 1 | ||||
-rw-r--r-- | cc/trees/layer_tree_settings.h | 1 |
4 files changed, 8 insertions, 2 deletions
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 9ec6fac..8ada9aa 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -54,7 +54,8 @@ PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, int id) is_using_lcd_text_(tree_impl->settings().can_use_lcd_text), needs_post_commit_initialization_(true), should_update_tile_priorities_(false), - has_gpu_rasterization_hint_(false) {} + has_gpu_rasterization_hint_(false), + should_use_low_res_tiling_(tree_impl->settings().create_low_res_tiling) {} PictureLayerImpl::~PictureLayerImpl() {} @@ -468,6 +469,8 @@ skia::RefPtr<SkPicture> PictureLayerImpl::GetPicture() { void PictureLayerImpl::SetHasGpuRasterizationHint(bool has_hint) { bool old_should_use_gpu_rasterization = ShouldUseGpuRasterization(); has_gpu_rasterization_hint_ = has_hint; + if (has_gpu_rasterization_hint_) + should_use_low_res_tiling_ = false; if (ShouldUseGpuRasterization() != old_should_use_gpu_rasterization) RemoveAllTilings(); } diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h index afa35f1..1d36f8d 100644 --- a/cc/layers/picture_layer_impl.h +++ b/cc/layers/picture_layer_impl.h @@ -87,7 +87,7 @@ class CC_EXPORT PictureLayerImpl void RemoveAllTilings(); void SyncFromActiveLayer(const PictureLayerImpl* other); void ManageTilings(bool animating_transform_to_screen); - bool ShouldHaveLowResTiling() const { return !ShouldUseGpuRasterization(); } + bool ShouldHaveLowResTiling() const { return should_use_low_res_tiling_; } virtual bool ShouldAdjustRasterScale( bool animating_transform_to_screen) const; virtual void RecalculateRasterScales( @@ -146,6 +146,7 @@ class CC_EXPORT PictureLayerImpl // after a CalculateContentsScale/ManageTilings. bool should_update_tile_priorities_; bool has_gpu_rasterization_hint_; + bool should_use_low_res_tiling_; friend class PictureLayer; DISALLOW_COPY_AND_ASSIGN(PictureLayerImpl); diff --git a/cc/trees/layer_tree_settings.cc b/cc/trees/layer_tree_settings.cc index 6df0b585..a3994ae 100644 --- a/cc/trees/layer_tree_settings.cc +++ b/cc/trees/layer_tree_settings.cc @@ -26,6 +26,7 @@ LayerTreeSettings::LayerTreeSettings() can_use_lcd_text(true), should_clear_root_render_pass(true), rasterization_site(CpuRasterization), + create_low_res_tiling(true), scrollbar_animator(NoAnimator), scrollbar_linear_fade_delay_ms(300), scrollbar_linear_fade_length_ms(300), diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h index 3ad7bf3..ecafb8f 100644 --- a/cc/trees/layer_tree_settings.h +++ b/cc/trees/layer_tree_settings.h @@ -36,6 +36,7 @@ class CC_EXPORT LayerTreeSettings { GpuRasterization, }; RasterizationSite rasterization_site; + bool create_low_res_tiling; enum ScrollbarAnimator { NoAnimator, |