OLD | NEW |
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 10 matching lines...) Expand all Loading... |
21 class CC_EXPORT LayerTreeHostCommon { | 21 class CC_EXPORT LayerTreeHostCommon { |
22 public: | 22 public: |
23 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co
nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&); | 23 static gfx::Rect calculateVisibleRect(const gfx::Rect& targetSurfaceRect, co
nst gfx::Rect& layerBoundRect, const WebKit::WebTransformationMatrix&); |
24 | 24 |
25 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic
eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz
e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList); | 25 static void calculateDrawTransforms(Layer* rootLayer, const gfx::Size& devic
eViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxTextureSiz
e, std::vector<scoped_refptr<Layer> >& renderSurfaceLayerList); |
26 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d
eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*,
int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList); | 26 static void calculateDrawTransforms(LayerImpl* rootLayer, const gfx::Size& d
eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, LayerSorter*,
int maxTextureSize, std::vector<LayerImpl*>& renderSurfaceLayerList); |
27 | 27 |
28 // Performs hit testing for a given renderSurfaceLayerList. | 28 // Performs hit testing for a given renderSurfaceLayerList. |
29 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo
int, std::vector<LayerImpl*>& renderSurfaceLayerList); | 29 static LayerImpl* findLayerThatIsHitByPoint(const gfx::PointF& screenSpacePo
int, std::vector<LayerImpl*>& renderSurfaceLayerList); |
30 | 30 |
| 31 static LayerImpl* findLayerThatIsHitByPointInTouchHandlerRegion(const gfx::P
ointF& screenSpacePoint, std::vector<LayerImpl*>& renderSurfaceLayerList); |
| 32 |
31 template<typename LayerType> static bool renderSurfaceContributesToTarget(La
yerType*, int targetSurfaceLayerID); | 33 template<typename LayerType> static bool renderSurfaceContributesToTarget(La
yerType*, int targetSurfaceLayerID); |
32 | 34 |
33 // Returns a layer with the given id if one exists in the subtree starting | 35 // Returns a layer with the given id if one exists in the subtree starting |
34 // from the given root layer (including mask and replica layers). | 36 // from the given root layer (including mask and replica layers). |
35 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType*
rootLayer, int layerId); | 37 template<typename LayerType> static LayerType* findLayerInSubtree(LayerType*
rootLayer, int layerId); |
36 | 38 |
37 static Layer* getChildAsRawPtr(const std::vector<scoped_refptr<Layer> >& chi
ldren, size_t index) | 39 static Layer* getChildAsRawPtr(const std::vector<scoped_refptr<Layer> >& chi
ldren, size_t index) |
38 { | 40 { |
39 return children[index].get(); | 41 return children[index].get(); |
40 } | 42 } |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 for (size_t i = 0; i < rootLayer->children().size(); ++i) { | 89 for (size_t i = 0; i < rootLayer->children().size(); ++i) { |
88 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch
ildren(), i), layerId)) | 90 if (LayerType* found = findLayerInSubtree(getChildAsRawPtr(rootLayer->ch
ildren(), i), layerId)) |
89 return found; | 91 return found; |
90 } | 92 } |
91 return 0; | 93 return 0; |
92 } | 94 } |
93 | 95 |
94 } // namespace cc | 96 } // namespace cc |
95 | 97 |
96 #endif // CC_LAYER_TREE_HOST_COMMON_H_ | 98 #endif // CC_LAYER_TREE_HOST_COMMON_H_ |
OLD | NEW |