Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/trees/layer_tree_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1441 ((!data_for_recursion->closest_match || | 1441 ((!data_for_recursion->closest_match || |
| 1442 distance_to_intersection > data_for_recursion->closest_distance))) { | 1442 distance_to_intersection > data_for_recursion->closest_distance))) { |
| 1443 data_for_recursion->closest_distance = distance_to_intersection; | 1443 data_for_recursion->closest_distance = distance_to_intersection; |
| 1444 data_for_recursion->closest_match = layer; | 1444 data_for_recursion->closest_match = layer; |
| 1445 } | 1445 } |
| 1446 } | 1446 } |
| 1447 | 1447 |
| 1448 static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) { | 1448 static bool ScrollsAnyDrawnRenderSurfaceLayerListMember(LayerImpl* layer) { |
| 1449 if (!layer->scrollable()) | 1449 if (!layer->scrollable()) |
| 1450 return false; | 1450 return false; |
| 1451 if (layer->IsDrawnRenderSurfaceLayerListMember()) | 1451 if (layer->draw_properties().layer_or_descendant_is_drawn) |
| 1452 return true; | 1452 return true; |
| 1453 | |
| 1453 if (!layer->scroll_children()) | 1454 if (!layer->scroll_children()) |
| 1454 return false; | 1455 return false; |
| 1455 for (std::set<LayerImpl*>::const_iterator it = | 1456 for (std::set<LayerImpl*>::const_iterator it = |
|
Ian Vollick
2015/03/06 18:56:16
Iterating over the children caused the brittleness
majidvp
2015/03/06 19:43:03
The issue was due to fact that layer was only chec
| |
| 1456 layer->scroll_children()->begin(); | 1457 layer->scroll_children()->begin(); |
| 1457 it != layer->scroll_children()->end(); | 1458 it != layer->scroll_children()->end(); |
| 1458 ++it) { | 1459 ++it) { |
| 1459 if ((*it)->IsDrawnRenderSurfaceLayerListMember()) | 1460 if ((*it)->draw_properties().layer_or_descendant_is_drawn) |
| 1460 return true; | 1461 return true; |
| 1461 } | 1462 } |
| 1462 return false; | 1463 return false; |
| 1463 } | 1464 } |
| 1464 | 1465 |
| 1465 struct FindScrollingLayerFunctor { | 1466 struct FindScrollingLayerFunctor { |
| 1466 bool operator()(LayerImpl* layer) const { | 1467 bool operator()(LayerImpl* layer) const { |
| 1467 return ScrollsAnyDrawnRenderSurfaceLayerListMember(layer); | 1468 return ScrollsAnyDrawnRenderSurfaceLayerListMember(layer); |
| 1468 } | 1469 } |
| 1469 }; | 1470 }; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1654 scoped_ptr<PendingPageScaleAnimation> pending_animation) { | 1655 scoped_ptr<PendingPageScaleAnimation> pending_animation) { |
| 1655 pending_page_scale_animation_ = pending_animation.Pass(); | 1656 pending_page_scale_animation_ = pending_animation.Pass(); |
| 1656 } | 1657 } |
| 1657 | 1658 |
| 1658 scoped_ptr<PendingPageScaleAnimation> | 1659 scoped_ptr<PendingPageScaleAnimation> |
| 1659 LayerTreeImpl::TakePendingPageScaleAnimation() { | 1660 LayerTreeImpl::TakePendingPageScaleAnimation() { |
| 1660 return pending_page_scale_animation_.Pass(); | 1661 return pending_page_scale_animation_.Pass(); |
| 1661 } | 1662 } |
| 1662 | 1663 |
| 1663 } // namespace cc | 1664 } // namespace cc |
| OLD | NEW |