| 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 | 5 |
| 6 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #include "CCLayerTreeHostCommon.h" | 8 #include "CCLayerTreeHostCommon.h" |
| 9 | 9 |
| 10 #include "CCLayerImpl.h" | 10 #include "CCLayerImpl.h" |
| 11 #include "CCLayerIterator.h" | 11 #include "CCLayerIterator.h" |
| 12 #include "CCLayerSorter.h" | 12 #include "CCLayerSorter.h" |
| 13 #include "CCMathUtil.h" | 13 #include "CCMathUtil.h" |
| 14 #include "CCRenderSurface.h" | 14 #include "CCRenderSurface.h" |
| 15 #include "FloatQuad.h" | 15 #include "FloatQuad.h" |
| 16 #include "IntRect.h" | 16 #include "IntRect.h" |
| 17 #include "LayerChromium.h" | 17 #include "LayerChromium.h" |
| 18 #include "RenderSurfaceChromium.h" | 18 #include "RenderSurfaceChromium.h" |
| 19 #include <public/WebTransformationMatrix.h> | 19 #include <public/WebTransformationMatrix.h> |
| 20 | 20 |
| 21 using WebKit::WebTransformationMatrix; | 21 using WebKit::WebTransformationMatrix; |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 CCScrollAndScaleSet::CCScrollAndScaleSet() |
| 26 { |
| 27 } |
| 28 |
| 29 CCScrollAndScaleSet::~CCScrollAndScaleSet() |
| 30 { |
| 31 } |
| 32 |
| 25 IntRect CCLayerTreeHostCommon::calculateVisibleRect(const IntRect& targetSurface
Rect, const IntRect& layerBoundRect, const WebTransformationMatrix& transform) | 33 IntRect CCLayerTreeHostCommon::calculateVisibleRect(const IntRect& targetSurface
Rect, const IntRect& layerBoundRect, const WebTransformationMatrix& transform) |
| 26 { | 34 { |
| 27 // Is this layer fully contained within the target surface? | 35 // Is this layer fully contained within the target surface? |
| 28 IntRect layerInSurfaceSpace = CCMathUtil::mapClippedRect(transform, layerBou
ndRect); | 36 IntRect layerInSurfaceSpace = CCMathUtil::mapClippedRect(transform, layerBou
ndRect); |
| 29 if (targetSurfaceRect.contains(layerInSurfaceSpace)) | 37 if (targetSurfaceRect.contains(layerInSurfaceSpace)) |
| 30 return layerBoundRect; | 38 return layerBoundRect; |
| 31 | 39 |
| 32 // If the layer doesn't fill up the entire surface, then find the part of | 40 // If the layer doesn't fill up the entire surface, then find the part of |
| 33 // the surface rect where the layer could be visible. This avoids trying to | 41 // the surface rect where the layer could be visible. This avoids trying to |
| 34 // project surface rect points that are behind the projection point. | 42 // project surface rect points that are behind the projection point. |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 876 | 884 |
| 877 foundLayer = currentLayer; | 885 foundLayer = currentLayer; |
| 878 break; | 886 break; |
| 879 } | 887 } |
| 880 | 888 |
| 881 // This can potentially return 0, which means the viewportPoint did not succ
essfully hit test any layers, not even the root layer. | 889 // This can potentially return 0, which means the viewportPoint did not succ
essfully hit test any layers, not even the root layer. |
| 882 return foundLayer; | 890 return foundLayer; |
| 883 } | 891 } |
| 884 | 892 |
| 885 } // namespace cc | 893 } // namespace cc |
| OLD | NEW |