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

Side by Side Diff: cc/layer_tree_host_impl.cc

Issue 11776033: Ensure that render surface layer list is not dirty/empty before hit testing for touch events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Calling ensureRenderSurfaceLayerList Created 7 years, 11 months 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 | « no previous file | cc/layer_tree_host_impl_unittest.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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698