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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 if (!m_currentlyScrollingLayerImpl) | 1291 if (!m_currentlyScrollingLayerImpl) |
1292 return false; | 1292 return false; |
1293 | 1293 |
1294 gfx::Vector2dF pendingDelta = scrollDelta; | 1294 gfx::Vector2dF pendingDelta = scrollDelta; |
1295 bool didScroll = false; | 1295 bool didScroll = false; |
1296 | 1296 |
1297 for (LayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerI
mpl = layerImpl->parent()) { | 1297 for (LayerImpl* layerImpl = m_currentlyScrollingLayerImpl; layerImpl; layerI
mpl = layerImpl->parent()) { |
1298 if (!layerImpl->scrollable()) | 1298 if (!layerImpl->scrollable()) |
1299 continue; | 1299 continue; |
1300 | 1300 |
1301 PinchZoomViewport* viewport = layerImpl == m_rootScrollLayerImpl ? &m_pi
nchZoomViewport : 0; | 1301 PinchZoomViewport* viewport = NULL; |
| 1302 if (m_settings.pageScalePinchZoomEnabled && layerImpl == m_rootScrollLay
erImpl) |
| 1303 viewport = &m_pinchZoomViewport; |
1302 gfx::Vector2dF appliedDelta; | 1304 gfx::Vector2dF appliedDelta; |
1303 if (m_scrollDeltaIsInViewportSpace) { | 1305 if (m_scrollDeltaIsInViewportSpace) { |
1304 float scaleFromViewportToScreenSpace = m_deviceScaleFactor; | 1306 float scaleFromViewportToScreenSpace = m_deviceScaleFactor; |
1305 appliedDelta = scrollLayerWithViewportSpaceDelta(viewport, *layerImp
l, scaleFromViewportToScreenSpace, viewportPoint, pendingDelta); | 1307 appliedDelta = scrollLayerWithViewportSpaceDelta(viewport, *layerImp
l, scaleFromViewportToScreenSpace, viewportPoint, pendingDelta); |
1306 } else | 1308 } else |
1307 appliedDelta = scrollLayerWithLocalDelta(*layerImpl, pendingDelta); | 1309 appliedDelta = scrollLayerWithLocalDelta(*layerImpl, pendingDelta); |
1308 | 1310 |
1309 // If the layer wasn't able to move, try the next one in the hierarchy. | 1311 // If the layer wasn't able to move, try the next one in the hierarchy. |
1310 float moveThresholdSquared = 0.1f * 0.1f; | 1312 float moveThresholdSquared = 0.1f * 0.1f; |
1311 if (appliedDelta.LengthSquared() < moveThresholdSquared) | 1313 if (appliedDelta.LengthSquared() < moveThresholdSquared) |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1632 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1634 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1633 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1635 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1634 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1636 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1635 m_client->setNeedsRedrawOnImplThread(); | 1637 m_client->setNeedsRedrawOnImplThread(); |
1636 | 1638 |
1637 for (size_t i = 0; i < layer->children().size(); ++i) | 1639 for (size_t i = 0; i < layer->children().size(); ++i) |
1638 animateScrollbarsRecursive(layer->children()[i], time); | 1640 animateScrollbarsRecursive(layer->children()[i], time); |
1639 } | 1641 } |
1640 | 1642 |
1641 } // namespace cc | 1643 } // namespace cc |
OLD | NEW |