Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11402002: Add API for hit testing layer_impl touchEventHandlerRegions from the host (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed call to haveTouchEventHandlersAt Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | webkit/compositor_bindings/web_to_ccinput_handler_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 m_client->setNeedsRedrawOnImplThread(); 319 m_client->setNeedsRedrawOnImplThread();
320 m_client->setNeedsCommitOnImplThread(); 320 m_client->setNeedsCommitOnImplThread();
321 } 321 }
322 322
323 void LayerTreeHostImpl::scheduleAnimation() 323 void LayerTreeHostImpl::scheduleAnimation()
324 { 324 {
325 m_client->setNeedsRedrawOnImplThread(); 325 m_client->setNeedsRedrawOnImplThread();
326 } 326 }
327 327
328 bool LayerTreeHostImpl::haveTouchEventHandlersAt(const gfx::Point& viewportPoint )
329 {
330
331 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca leFactor);
332
333 // First find out which layer was hit from the saved list of visible layers
334 // in the most recent frame.
335 LayerImpl* layerImplHitByPointInTouchHandlerRegion = LayerTreeHostCommon::fi ndLayerThatIsHitByPointInTouchHandlerRegion(deviceViewportPoint, m_renderSurface LayerList);
336
337 if (layerImplHitByPointInTouchHandlerRegion)
338 return true;
339
340 return false;
341 }
342
328 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons t LayerList& renderSurfaceLayerList) 343 void LayerTreeHostImpl::trackDamageForAllSurfaces(LayerImpl* rootDrawLayer, cons t LayerList& renderSurfaceLayerList)
329 { 344 {
330 // For now, we use damage tracking to compute a global scissor. To do this, we must 345 // For now, we use damage tracking to compute a global scissor. To do this, we must
331 // compute all damage tracking before drawing anything, so that we know the root 346 // compute all damage tracking before drawing anything, so that we know the root
332 // damage rect. The root damage rect is then used to scissor each surface. 347 // damage rect. The root damage rect is then used to scissor each surface.
333 348
334 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) { 349 for (int surfaceIndex = renderSurfaceLayerList.size() - 1; surfaceIndex >= 0 ; --surfaceIndex) {
335 LayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex]; 350 LayerImpl* renderSurfaceLayer = renderSurfaceLayerList[surfaceIndex];
336 RenderSurfaceImpl* renderSurface = renderSurfaceLayer->renderSurface(); 351 RenderSurfaceImpl* renderSurface = renderSurfaceLayer->renderSurface();
337 DCHECK(renderSurface); 352 DCHECK(renderSurface);
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1503 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1489 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1504 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1490 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1505 if (scrollbarController && scrollbarController->animate(monotonicTime))
1491 m_client->setNeedsRedrawOnImplThread(); 1506 m_client->setNeedsRedrawOnImplThread();
1492 1507
1493 for (size_t i = 0; i < layer->children().size(); ++i) 1508 for (size_t i = 0; i < layer->children().size(); ++i)
1494 animateScrollbarsRecursive(layer->children()[i], time); 1509 animateScrollbarsRecursive(layer->children()[i], time);
1495 } 1510 }
1496 1511
1497 } // namespace cc 1512 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.h ('k') | webkit/compositor_bindings/web_to_ccinput_handler_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698