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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 m_client->setNeedsRedrawOnImplThread(); | 350 m_client->setNeedsRedrawOnImplThread(); |
351 } | 351 } |
352 | 352 |
353 bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint
) | 353 bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint
) |
354 { | 354 { |
355 | 355 |
356 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca
leFactor); | 356 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca
leFactor); |
357 | 357 |
358 // First find out which layer was hit from the saved list of visible layers | 358 // First find out which layer was hit from the saved list of visible layers |
359 // in the most recent frame. | 359 // in the most recent frame. |
360 LayerImpl* layerImplHitByPointInTouchHandlerRegion = LayerTreeHostCommon::fi
ndLayerThatIsHitByPointInTouchHandlerRegion(deviceViewportPoint, m_renderSurface
LayerList); | 360 LayerImpl* layerImpl = LayerTreeHostCommon::findLayerThatIsHitByPoint(device
ViewportPoint, m_renderSurfaceLayerList); |
361 | 361 |
362 if (layerImplHitByPointInTouchHandlerRegion) | 362 // Walk up the hierarchy and look for a layer with a touch event handler reg
ion that the given point hits. |
363 return true; | 363 for (; layerImpl; layerImpl = layerImpl->parent()) { |
| 364 if (LayerTreeHostCommon::layerHasTouchEventHandlersAt(deviceViewportPoint,
layerImpl)) |
| 365 return true; |
| 366 } |
364 | 367 |
365 return false; | 368 return false; |
366 } | 369 } |
367 | 370 |
368 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons
t LayerList& renderSurfaceLayerList) | 371 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons
t LayerList& renderSurfaceLayerList) |
369 { | 372 { |
370 // For now, we use damage tracking to compute a global scissor. To do this,
we must | 373 // For now, we use damage tracking to compute a global scissor. To do this,
we must |
371 // compute all damage tracking before drawing anything, so that we know the
root | 374 // compute all damage tracking before drawing anything, so that we know the
root |
372 // damage rect. The root damage rect is then used to scissor each surface. | 375 // damage rect. The root damage rect is then used to scissor each surface. |
373 | 376 |
(...skipping 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1707 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1705 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1708 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1706 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1709 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1707 m_client->setNeedsRedrawOnImplThread(); | 1710 m_client->setNeedsRedrawOnImplThread(); |
1708 | 1711 |
1709 for (size_t i = 0; i < layer->children().size(); ++i) | 1712 for (size_t i = 0; i < layer->children().size(); ++i) |
1710 animateScrollbarsRecursive(layer->children()[i], time); | 1713 animateScrollbarsRecursive(layer->children()[i], time); |
1711 } | 1714 } |
1712 | 1715 |
1713 } // namespace cc | 1716 } // namespace cc |
OLD | NEW |