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

Unified Diff: cc/trees/tree_synchronizer.cc

Issue 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to r248052. Created 6 years, 11 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/trees/layer_tree_impl.cc ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/tree_synchronizer.cc
diff --git a/cc/trees/tree_synchronizer.cc b/cc/trees/tree_synchronizer.cc
index 27f9dab38d868f9d5a82a661b7d21481fa2360f8..1c1c7e164ad00244f0faa253432ccde7fc497202 100644
--- a/cc/trees/tree_synchronizer.cc
+++ b/cc/trees/tree_synchronizer.cc
@@ -25,6 +25,13 @@ void CollectExistingLayerImplRecursive(ScopedPtrLayerImplMap* old_layers,
if (!layer_impl)
return;
+ layer_impl->ClearScrollbars();
+ if (ScrollbarLayerImplBase* scrollbar_layer =
+ layer_impl->ToScrollbarLayer()) {
+ scrollbar_layer->ClearClipLayer();
+ scrollbar_layer->ClearScrollLayer();
+ }
+
OwnedLayerImplList& children = layer_impl->children();
for (OwnedLayerImplList::iterator it = children.begin();
it != children.end();
@@ -112,11 +119,6 @@ scoped_ptr<LayerImpl> SynchronizeTreesRecursiveInternal(
layer_impl->SetReplicaLayer(SynchronizeTreesRecursiveInternal(
new_layers, old_layers, layer->replica_layer(), tree_impl));
- // Remove all dangling pointers. The pointers will be setup later in
- // UpdateScrollbarLayerPointersRecursive phase
- layer_impl->SetHorizontalScrollbarLayer(NULL);
- layer_impl->SetVerticalScrollbarLayer(NULL);
-
return layer_impl.Pass();
}
@@ -160,17 +162,9 @@ void UpdateScrollbarLayerPointersRecursiveInternal(
iter != new_layers->end()
? static_cast<ScrollbarLayerImplBase*>(iter->second)
: NULL;
- iter = new_layers->find(scrollbar_layer->ScrollLayerId());
- LayerImpl* scroll_layer_impl =
- iter != new_layers->end() ? iter->second : NULL;
-
DCHECK(scrollbar_layer_impl);
- DCHECK(scroll_layer_impl);
- if (scrollbar_layer->orientation() == HORIZONTAL)
- scroll_layer_impl->SetHorizontalScrollbarLayer(scrollbar_layer_impl);
- else
- scroll_layer_impl->SetVerticalScrollbarLayer(scrollbar_layer_impl);
+ scrollbar_layer->PushScrollClipPropertiesTo(scrollbar_layer_impl);
}
void UpdateScrollbarLayerPointersRecursive(const RawPtrLayerImplMap* new_layers,
@@ -205,6 +199,8 @@ void TreeSynchronizer::PushPropertiesInternal(
if (push_layer)
layer->PushPropertiesTo(layer_impl);
+ else if (layer->ToScrollbarLayer())
+ layer->ToScrollbarLayer()->PushScrollClipPropertiesTo(layer_impl);
size_t num_dependents_need_push_properties = 0;
if (recurse_on_children_and_dependents) {
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | content/public/common/common_param_traits_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698