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

Side by Side Diff: cc/layer_tree_host_common.cc

Issue 12280014: cc: Don't consider HUD layer for touches (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unittest Created 7 years, 10 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_common_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_common.h" 5 #include "cc/layer_tree_host_common.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "cc/heads_up_display_layer_impl.h"
10 #include "cc/layer.h" 11 #include "cc/layer.h"
11 #include "cc/layer_impl.h" 12 #include "cc/layer_impl.h"
12 #include "cc/layer_iterator.h" 13 #include "cc/layer_iterator.h"
13 #include "cc/layer_sorter.h" 14 #include "cc/layer_sorter.h"
15 #include "cc/layer_tree_impl.h"
14 #include "cc/math_util.h" 16 #include "cc/math_util.h"
15 #include "cc/render_surface.h" 17 #include "cc/render_surface.h"
16 #include "cc/render_surface_impl.h" 18 #include "cc/render_surface_impl.h"
17 #include "ui/gfx/point_conversions.h" 19 #include "ui/gfx/point_conversions.h"
18 #include "ui/gfx/rect_conversions.h" 20 #include "ui/gfx/rect_conversions.h"
19 #include "ui/gfx/transform.h" 21 #include "ui/gfx/transform.h"
20 22
21 namespace cc { 23 namespace cc {
22 24
23 ScrollAndScaleSet::ScrollAndScaleSet() 25 ScrollAndScaleSet::ScrollAndScaleSet()
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 gfx::RectF contentRect(gfx::PointF(), currentLayer->contentBounds()); 1149 gfx::RectF contentRect(gfx::PointF(), currentLayer->contentBounds());
1148 if (!pointHitsRect(screenSpacePoint, currentLayer->screenSpaceTransform( ), contentRect)) 1150 if (!pointHitsRect(screenSpacePoint, currentLayer->screenSpaceTransform( ), contentRect))
1149 continue; 1151 continue;
1150 1152
1151 // At this point, we think the point does hit the layer, but we need to walk up 1153 // At this point, we think the point does hit the layer, but we need to walk up
1152 // the parents to ensure that the layer was not clipped in such a way th at the 1154 // the parents to ensure that the layer was not clipped in such a way th at the
1153 // hit point actually should not hit the layer. 1155 // hit point actually should not hit the layer.
1154 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, currentLayer)) 1156 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, currentLayer))
1155 continue; 1157 continue;
1156 1158
1159 // Skip the HUD layer.
1160 if (currentLayer == currentLayer->layerTreeImpl()->hud_layer())
1161 continue;
1162
1157 foundLayer = currentLayer; 1163 foundLayer = currentLayer;
1158 break; 1164 break;
1159 } 1165 }
1160 1166
1161 // This can potentially return 0, which means the screenSpacePoint did not s uccessfully hit test any layers, not even the root layer. 1167 // This can potentially return 0, which means the screenSpacePoint did not s uccessfully hit test any layers, not even the root layer.
1162 return foundLayer; 1168 return foundLayer;
1163 } 1169 }
1164 1170
1165 LayerImpl* LayerTreeHostCommon::findLayerThatIsHitByPointInTouchHandlerRegion(co nst gfx::PointF& screenSpacePoint, const std::vector<LayerImpl*>& renderSurfaceL ayerList) 1171 LayerImpl* LayerTreeHostCommon::findLayerThatIsHitByPointInTouchHandlerRegion(co nst gfx::PointF& screenSpacePoint, const std::vector<LayerImpl*>& renderSurfaceL ayerList)
1166 { 1172 {
(...skipping 29 matching lines...) Expand all
1196 1202
1197 // At this point, we think the point does hit the touch event handler region o n the layer, but we need to walk up 1203 // At this point, we think the point does hit the touch event handler region o n the layer, but we need to walk up
1198 // the parents to ensure that the layer was not clipped in such a way that the 1204 // the parents to ensure that the layer was not clipped in such a way that the
1199 // hit point actually should not hit the layer. 1205 // hit point actually should not hit the layer.
1200 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl)) 1206 if (pointIsClippedBySurfaceOrClipRect(screenSpacePoint, layerImpl))
1201 return false; 1207 return false;
1202 1208
1203 return true; 1209 return true;
1204 } 1210 }
1205 } // namespace cc 1211 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698