| 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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 m_client->setNeedsCommitOnImplThread(); | 369 m_client->setNeedsCommitOnImplThread(); |
| 370 } | 370 } |
| 371 | 371 |
| 372 void LayerTreeHostImpl::scheduleAnimation() | 372 void LayerTreeHostImpl::scheduleAnimation() |
| 373 { | 373 { |
| 374 m_client->setNeedsRedrawOnImplThread(); | 374 m_client->setNeedsRedrawOnImplThread(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint
) | 377 bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint
) |
| 378 { | 378 { |
| 379 if (!ensureRenderSurfaceLayerList()) |
| 380 return false; |
| 379 | 381 |
| 380 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca
leFactor); | 382 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca
leFactor); |
| 381 | 383 |
| 382 // First find out which layer was hit from the saved list of visible layers | 384 // First find out which layer was hit from the saved list of visible layers |
| 383 // in the most recent frame. | 385 // in the most recent frame. |
| 384 LayerImpl* layerImpl = LayerTreeHostCommon::findLayerThatIsHitByPoint(device
ViewportPoint, activeTree()->RenderSurfaceLayerList()); | 386 LayerImpl* layerImpl = LayerTreeHostCommon::findLayerThatIsHitByPoint(device
ViewportPoint, activeTree()->RenderSurfaceLayerList()); |
| 385 | 387 |
| 386 // Walk up the hierarchy and look for a layer with a touch event handler reg
ion that the given point hits. | 388 // Walk up the hierarchy and look for a layer with a touch event handler reg
ion that the given point hits. |
| 387 for (; layerImpl; layerImpl = layerImpl->parent()) { | 389 for (; layerImpl; layerImpl = layerImpl->parent()) { |
| 388 if (LayerTreeHostCommon::layerHasTouchEventHandlersAt(deviceViewportPoint,
layerImpl)) | 390 if (LayerTreeHostCommon::layerHasTouchEventHandlersAt(deviceViewportPoint,
layerImpl)) |
| (...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1703 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
| 1702 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1704 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
| 1703 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1705 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
| 1704 m_client->setNeedsRedrawOnImplThread(); | 1706 m_client->setNeedsRedrawOnImplThread(); |
| 1705 | 1707 |
| 1706 for (size_t i = 0; i < layer->children().size(); ++i) | 1708 for (size_t i = 0; i < layer->children().size(); ++i) |
| 1707 animateScrollbarsRecursive(layer->children()[i], time); | 1709 animateScrollbarsRecursive(layer->children()[i], time); |
| 1708 } | 1710 } |
| 1709 | 1711 |
| 1710 } // namespace cc | 1712 } // namespace cc |
| OLD | NEW |