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 "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/layer_tree_host_impl.h" | 7 #include "cc/layer_tree_host_impl.h" |
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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 313 |
314 m_client->setNeedsRedrawOnImplThread(); | 314 m_client->setNeedsRedrawOnImplThread(); |
315 m_client->setNeedsCommitOnImplThread(); | 315 m_client->setNeedsCommitOnImplThread(); |
316 } | 316 } |
317 | 317 |
318 void LayerTreeHostImpl::scheduleAnimation() | 318 void LayerTreeHostImpl::scheduleAnimation() |
319 { | 319 { |
320 m_client->setNeedsRedrawOnImplThread(); | 320 m_client->setNeedsRedrawOnImplThread(); |
321 } | 321 } |
322 | 322 |
| 323 bool LayerTreeHostImpl::checkTouchEventHandlerRegionHit(const gfx::Point& viewpo
rtPoint) |
| 324 { |
| 325 |
| 326 gfx::PointF deviceViewportPoint = viewportPoint.Scale(m_deviceScaleFactor); |
| 327 |
| 328 // First find out which layer was hit from the saved list of visible layers |
| 329 // in the most recent frame. |
| 330 LayerImpl* layerImplHitByPointInTouchHandlerRegion = LayerTreeHostCommon::fi
ndLayerThatIsHitByPointInTouchHandlerRegion(deviceViewportPoint, m_renderSurface
LayerList); |
| 331 |
| 332 if (layerImplHitByPointInTouchHandlerRegion) |
| 333 return true; |
| 334 |
| 335 return false; |
| 336 } |
| 337 |
323 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons
t LayerList& renderSurfaceLayerList) | 338 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons
t LayerList& renderSurfaceLayerList) |
324 { | 339 { |
325 // For now, we use damage tracking to compute a global scissor. To do this,
we must | 340 // For now, we use damage tracking to compute a global scissor. To do this,
we must |
326 // compute all damage tracking before drawing anything, so that we know the
root | 341 // compute all damage tracking before drawing anything, so that we know the
root |
327 // damage rect. The root damage rect is then used to scissor each surface. | 342 // damage rect. The root damage rect is then used to scissor each surface. |
328 | 343 |
329 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { | 344 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0
; --surfaceIndex) { |
330 LayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; | 345 LayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; |
331 RenderSurfaceImpl* renderSurface = renderSurfaceLayer->renderSurface(); | 346 RenderSurfaceImpl* renderSurface = renderSurfaceLayer->renderSurface(); |
332 DCHECK(renderSurface); | 347 DCHECK(renderSurface); |
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); | 1487 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio
nController(); |
1473 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); | 1488 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); |
1474 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1489 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1475 m_client->setNeedsRedrawOnImplThread(); | 1490 m_client->setNeedsRedrawOnImplThread(); |
1476 | 1491 |
1477 for (size_t i = 0; i < layer->children().size(); ++i) | 1492 for (size_t i = 0; i < layer->children().size(); ++i) |
1478 animateScrollbarsRecursive(layer->children()[i], time); | 1493 animateScrollbarsRecursive(layer->children()[i], time); |
1479 } | 1494 } |
1480 | 1495 |
1481 } // namespace cc | 1496 } // namespace cc |
OLD | NEW |