| 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 CCLayerTreeHostCommon_h | 5 #ifndef CCLayerTreeHostCommon_h |
| 6 #define CCLayerTreeHostCommon_h | 6 #define CCLayerTreeHostCommon_h |
| 7 | 7 |
| 8 #include "IntRect.h" | 8 #include "IntRect.h" |
| 9 #include "IntSize.h" | 9 #include "IntSize.h" |
| 10 #include <public/WebTransformationMatrix.h> | 10 #include <public/WebTransformationMatrix.h> |
| 11 #include <wtf/RefPtr.h> | 11 #include <wtf/RefPtr.h> |
| 12 #include <wtf/Vector.h> | 12 #include <wtf/Vector.h> |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 | 15 |
| 16 class CCLayerImpl; | 16 class CCLayerImpl; |
| 17 class CCLayerSorter; | 17 class CCLayerSorter; |
| 18 class LayerChromium; | 18 class LayerChromium; |
| 19 | 19 |
| 20 class CCLayerTreeHostCommon { | 20 class CCLayerTreeHostCommon { |
| 21 public: | 21 public: |
| 22 static IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const
IntRect& layerBoundRect, const WebKit::WebTransformationMatrix&); | 22 static IntRect calculateVisibleRect(const IntRect& targetSurfaceRect, const
IntRect& layerBoundRect, const WebKit::WebTransformationMatrix&); |
| 23 | 23 |
| 24 static void calculateDrawTransforms(LayerChromium* rootLayer, const IntSize&
deviceViewportSize, float deviceScaleFactor, int maxTextureSize, Vector<RefPtr<
LayerChromium> >& renderSurfaceLayerList); | 24 static void calculateDrawTransforms(LayerChromium* rootLayer, const IntSize&
deviceViewportSize, float deviceScaleFactor, float pageScaleFactor, int maxText
ureSize, Vector<RefPtr<LayerChromium> >& renderSurfaceLayerList); |
| 25 static void calculateDrawTransforms(CCLayerImpl* rootLayer, const IntSize& d
eviceViewportSize, float deviceScaleFactor, CCLayerSorter*, int maxTextureSize,
Vector<CCLayerImpl*>& renderSurfaceLayerList); | 25 static void calculateDrawTransforms(CCLayerImpl* rootLayer, const IntSize& d
eviceViewportSize, float deviceScaleFactor, float pageScaleFactor, CCLayerSorter
*, int maxTextureSize, Vector<CCLayerImpl*>& renderSurfaceLayerList); |
| 26 | 26 |
| 27 static void calculateVisibleRects(Vector<CCLayerImpl*>& renderSurfaceLayerLi
st); | 27 static void calculateVisibleRects(Vector<CCLayerImpl*>& renderSurfaceLayerLi
st); |
| 28 static void calculateVisibleRects(Vector<RefPtr<LayerChromium> >& renderSurf
aceLayerList); | 28 static void calculateVisibleRects(Vector<RefPtr<LayerChromium> >& renderSurf
aceLayerList); |
| 29 | 29 |
| 30 // Performs hit testing for a given renderSurfaceLayerList. | 30 // Performs hit testing for a given renderSurfaceLayerList. |
| 31 static CCLayerImpl* findLayerThatIsHitByPoint(const IntPoint& viewportPoint,
Vector<CCLayerImpl*>& renderSurfaceLayerList); | 31 static CCLayerImpl* findLayerThatIsHitByPoint(const IntPoint& viewportPoint,
Vector<CCLayerImpl*>& renderSurfaceLayerList); |
| 32 | 32 |
| 33 template<typename LayerType> static bool renderSurfaceContributesToTarget(La
yerType*, int targetSurfaceLayerID); | 33 template<typename LayerType> static bool renderSurfaceContributesToTarget(La
yerType*, int targetSurfaceLayerID); |
| 34 | 34 |
| 35 // 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 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 for (size_t i = 0; i < rootLayer->children().size(); ++i) { | 76 for (size_t i = 0; i < rootLayer->children().size(); ++i) { |
| 77 if (LayerType* found = findLayerInSubtree(rootLayer->children()[i].get()
, layerId)) | 77 if (LayerType* found = findLayerInSubtree(rootLayer->children()[i].get()
, layerId)) |
| 78 return found; | 78 return found; |
| 79 } | 79 } |
| 80 return 0; | 80 return 0; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace cc | 83 } // namespace cc |
| 84 | 84 |
| 85 #endif | 85 #endif |
| OLD | NEW |