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

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: Added unit test and calling updateDrawProperties directly 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 updateDrawProperties();
enne (OOO) 2013/01/08 02:26:49 This is just a tiny request, but can you do what s
379 380
380 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca leFactor); 381 gfx::PointF deviceViewportPoint = gfx::ScalePoint(viewportPoint, m_deviceSca leFactor);
381 382
382 // First find out which layer was hit from the saved list of visible layers 383 // First find out which layer was hit from the saved list of visible layers
383 // in the most recent frame. 384 // in the most recent frame.
384 LayerImpl* layerImpl = LayerTreeHostCommon::findLayerThatIsHitByPoint(device ViewportPoint, activeTree()->RenderSurfaceLayerList()); 385 LayerImpl* layerImpl = LayerTreeHostCommon::findLayerThatIsHitByPoint(device ViewportPoint, activeTree()->RenderSurfaceLayerList());
385 386
386 // Walk up the hierarchy and look for a layer with a touch event handler reg ion that the given point hits. 387 // 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()) { 388 for (; layerImpl; layerImpl = layerImpl->parent()) {
388 if (LayerTreeHostCommon::layerHasTouchEventHandlersAt(deviceViewportPoint, layerImpl)) 389 if (LayerTreeHostCommon::layerHasTouchEventHandlersAt(deviceViewportPoint, layerImpl))
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1701 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController(); 1702 ScrollbarAnimationController* scrollbarController = layer->scrollbarAnimatio nController();
1702 double monotonicTime = (time - base::TimeTicks()).InSecondsF(); 1703 double monotonicTime = (time - base::TimeTicks()).InSecondsF();
1703 if (scrollbarController && scrollbarController->animate(monotonicTime)) 1704 if (scrollbarController && scrollbarController->animate(monotonicTime))
1704 m_client->setNeedsRedrawOnImplThread(); 1705 m_client->setNeedsRedrawOnImplThread();
1705 1706
1706 for (size_t i = 0; i < layer->children().size(); ++i) 1707 for (size_t i = 0; i < layer->children().size(); ++i)
1707 animateScrollbarsRecursive(layer->children()[i], time); 1708 animateScrollbarsRecursive(layer->children()[i], time);
1708 } 1709 }
1709 1710
1710 } // namespace cc 1711 } // 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