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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 22567004: Ignore should-scroll-on-main-thread if main frame is not scrollable (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 | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index ea87e3041b5703329e2ac492b8465715bca56014..d362a6dc31bc1ca298d180893026fa73c9c8c1c7 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -690,22 +690,6 @@ bool LayerTreeHost::UpdateLayers(ResourceUpdateQueue* queue,
return UpdateLayers(root_layer(), queue);
}
-static Layer* FindFirstScrollableLayer(Layer* layer) {
- if (!layer)
- return NULL;
-
- if (layer->scrollable())
- return layer;
-
- for (size_t i = 0; i < layer->children().size(); ++i) {
- Layer* found = FindFirstScrollableLayer(layer->children()[i].get());
- if (found)
- return found;
- }
-
- return NULL;
-}
-
void LayerTreeHost::CalculateLCDTextMetricsCallback(Layer* layer) {
if (!layer->SupportsLCDText())
return;
@@ -733,7 +717,8 @@ bool LayerTreeHost::UpdateLayers(Layer* root_layer,
{
UpdateHudLayer();
- Layer* root_scroll = FindFirstScrollableLayer(root_layer);
+ Layer* root_scroll =
+ LayerTreeHostCommon::FindFirstScrollableLayer(root_layer);
if (hud_layer_) {
hud_layer_->PrepareForCalculateDrawProperties(
@@ -1008,7 +993,8 @@ void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) {
}
gfx::Vector2d root_scroll_delta;
- Layer* root_scroll_layer = FindFirstScrollableLayer(root_layer_.get());
+ Layer* root_scroll_layer =
+ LayerTreeHostCommon::FindFirstScrollableLayer(root_layer_.get());
for (size_t i = 0; i < info.scrolls.size(); ++i) {
Layer* layer =
@@ -1027,7 +1013,8 @@ void LayerTreeHost::ApplyScrollAndScale(const ScrollAndScaleSet& info) {
if (!root_scroll_delta.IsZero() || info.page_scale_delta != 1.f) {
// SetScrollOffsetFromImplSide above could have destroyed the tree,
// so re-get this layer before doing anything to it.
- root_scroll_layer = FindFirstScrollableLayer(root_layer_.get());
+ root_scroll_layer =
+ LayerTreeHostCommon::FindFirstScrollableLayer(root_layer_.get());
// Preemptively apply the scroll offset and scale delta here before sending
// it to the client. If the client comes back and sets it to the same
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/trees/layer_tree_host_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698