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