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

Side by Side Diff: cc/layer_tree_host_common.h

Issue 11534024: Check whether a touch point hits touch event handler regions in root layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed extra qualification Created 8 years 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.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 #ifndef CC_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_LAYER_TREE_HOST_COMMON_H_
6 #define CC_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "cc/cc_export.h" 9 #include "cc/cc_export.h"
10 #include "cc/scoped_ptr_vector.h" 10 #include "cc/scoped_ptr_vector.h"
(...skipping 11 matching lines...) Expand all
22 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const gfx::Transform&); 22 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co nst gfx::Rect& layerBoundRect, const gfx::Transform&);
23 23
24 static void calculateDrawProperties(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList); 24 static void calculateDrawProperties(Layer* rootLayer, const gfx::Size& devic eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList);
25 static void calculateDrawProperties(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextur eSize, std::vector<LayerImpl*>& renderSurfaceLayerList); 25 static void calculateDrawProperties(LayerImpl* rootLayer, const gfx::Size& d eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextur eSize, std::vector<LayerImpl*>& renderSurfaceLayerList);
26 26
27 // Performs hit testing for a given renderSurfaceLayerList. 27 // Performs hit testing for a given renderSurfaceLayerList.
28 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList); 28 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo int, std::vector<LayerImpl*>& renderSurfaceLayerList);
29 29
30 static LayerImpl* findLayerThatIsHitByPointInTouchHandlerRegion(const gfx::P ointF& screenSpacePoint, std::vector<LayerImpl*>& renderSurfaceLayerList); 30 static LayerImpl* findLayerThatIsHitByPointInTouchHandlerRegion(const gfx::P ointF& screenSpacePoint, std::vector<LayerImpl*>& renderSurfaceLayerList);
31 31
32 static bool layerHasTouchEventHandlersAt(const gfx::PointF& screenSpacePoint , LayerImpl* layerImpl);
33
32 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID); 34 template<typename LayerType> static bool renderSurfaceContributesToTarget(La yerType*, int targetSurfaceLayerID);
33 35
34 // Returns a layer with the given id if one exists in the subtree starting 36 // Returns a layer with the given id if one exists in the subtree starting
35 // from the given root layer (including mask and replica layers). 37 // from the given root layer (including mask and replica layers).
36 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId); 38 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType* rootLayer, int layerId);
37 39
38 static Layer* getChildAsRawPtr(const std::vector<scoped_refptr<Layer> >& chi ldren, size_t index) 40 static Layer* getChildAsRawPtr(const std::vector<scoped_refptr<Layer> >& chi ldren, size_t index)
39 { 41 {
40 return children[index].get(); 42 return children[index].get();
41 } 43 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 for (size_t i = 0; i < rootLayer->children().size(); ++i) { 90 for (size_t i = 0; i < rootLayer->children().size(); ++i) {
89 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId)) 91 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch ildren(), i), layerId))
90 return found; 92 return found;
91 } 93 }
92 return 0; 94 return 0;
93 } 95 }
94 96
95 } // namespace cc 97 } // namespace cc
96 98
97 #endif // CC_LAYER_TREE_HOST_COMMON_H_ 99 #endif // CC_LAYER_TREE_HOST_COMMON_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698