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

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 27718006: cc: Fix touch hit-testing for overlapping layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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 | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | 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/trees/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 429
430 bool LayerTreeHostImpl::HaveTouchEventHandlersAt(gfx::Point viewport_point) { 430 bool LayerTreeHostImpl::HaveTouchEventHandlersAt(gfx::Point viewport_point) {
431 if (!settings_.touch_hit_testing) 431 if (!settings_.touch_hit_testing)
432 return true; 432 return true;
433 if (!EnsureRenderSurfaceLayerList()) 433 if (!EnsureRenderSurfaceLayerList())
434 return false; 434 return false;
435 435
436 gfx::PointF device_viewport_point = 436 gfx::PointF device_viewport_point =
437 gfx::ScalePoint(viewport_point, device_scale_factor_); 437 gfx::ScalePoint(viewport_point, device_scale_factor_);
438 438
439 // First find out which layer was hit from the saved list of visible layers 439 LayerImpl* layer_impl =
440 // in the most recent frame. 440 LayerTreeHostCommon::FindLayerThatIsHitByPointInTouchHandlerRegion(
441 LayerImpl* layer_impl = LayerTreeHostCommon::FindLayerThatIsHitByPoint( 441 device_viewport_point,
442 device_viewport_point, 442 active_tree_->RenderSurfaceLayerList());
443 active_tree_->RenderSurfaceLayerList()); 443 return layer_impl != NULL;
444
445 // Walk up the hierarchy and look for a layer with a touch event handler
446 // region that the given point hits.
447 for (; layer_impl; layer_impl = layer_impl->parent()) {
448 if (LayerTreeHostCommon::LayerHasTouchEventHandlersAt(device_viewport_point,
449 layer_impl))
450 return true;
451 }
452
453 return false;
454 } 444 }
455 445
456 void LayerTreeHostImpl::SetLatencyInfoForInputEvent( 446 void LayerTreeHostImpl::SetLatencyInfoForInputEvent(
457 const ui::LatencyInfo& latency_info) { 447 const ui::LatencyInfo& latency_info) {
458 active_tree()->SetLatencyInfo(latency_info); 448 active_tree()->SetLatencyInfo(latency_info);
459 } 449 }
460 450
461 void LayerTreeHostImpl::TrackDamageForAllSurfaces( 451 void LayerTreeHostImpl::TrackDamageForAllSurfaces(
462 LayerImpl* root_draw_layer, 452 LayerImpl* root_draw_layer,
463 const LayerImplList& render_surface_layer_list) { 453 const LayerImplList& render_surface_layer_list) {
(...skipping 2352 matching lines...) Expand 10 before | Expand all | Expand 10 after
2816 std::set<UIResourceId>::iterator found_in_evicted = 2806 std::set<UIResourceId>::iterator found_in_evicted =
2817 evicted_ui_resources_.find(uid); 2807 evicted_ui_resources_.find(uid);
2818 if (found_in_evicted == evicted_ui_resources_.end()) 2808 if (found_in_evicted == evicted_ui_resources_.end())
2819 return; 2809 return;
2820 evicted_ui_resources_.erase(found_in_evicted); 2810 evicted_ui_resources_.erase(found_in_evicted);
2821 if (evicted_ui_resources_.empty()) 2811 if (evicted_ui_resources_.empty())
2822 client_->OnCanDrawStateChanged(CanDraw()); 2812 client_->OnCanDrawStateChanged(CanDraw());
2823 } 2813 }
2824 2814
2825 } // namespace cc 2815 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698