OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
6 * | 6 * |
7 * Other contributors: | 7 * Other contributors: |
8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 // intersect with that when painting column contents. | 1639 // intersect with that when painting column contents. |
1640 ClipRect ancestorClipRect = dirtyRect; | 1640 ClipRect ancestorClipRect = dirtyRect; |
1641 if (const PaintLayer* paginationParentLayer = | 1641 if (const PaintLayer* paginationParentLayer = |
1642 enclosingPaginationLayer()->parent()) { | 1642 enclosingPaginationLayer()->parent()) { |
1643 const PaintLayer* ancestorLayer = | 1643 const PaintLayer* ancestorLayer = |
1644 rootLayerIsInsidePaginationLayer ? paginationParentLayer : rootLayer; | 1644 rootLayerIsInsidePaginationLayer ? paginationParentLayer : rootLayer; |
1645 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, | 1645 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, |
1646 overlayScrollbarClipBehavior); | 1646 overlayScrollbarClipBehavior); |
1647 if (respectOverflowClip == IgnoreOverflowClip) | 1647 if (respectOverflowClip == IgnoreOverflowClip) |
1648 clipRectsContext.setIgnoreOverflowClip(); | 1648 clipRectsContext.setIgnoreOverflowClip(); |
1649 ancestorClipRect = enclosingPaginationLayer() | 1649 |
1650 ->clipper(geometryMapperOption) | 1650 enclosingPaginationLayer() |
1651 .backgroundClipRect(clipRectsContext); | 1651 ->clipper(geometryMapperOption) |
| 1652 .calculateBackgroundClipRect(clipRectsContext, ancestorClipRect); |
1652 if (rootLayerIsInsidePaginationLayer) | 1653 if (rootLayerIsInsidePaginationLayer) |
1653 ancestorClipRect.moveBy( | 1654 ancestorClipRect.moveBy( |
1654 -rootLayer->visualOffsetFromAncestor(ancestorLayer)); | 1655 -rootLayer->visualOffsetFromAncestor(ancestorLayer)); |
1655 ancestorClipRect.intersect(dirtyRect); | 1656 ancestorClipRect.intersect(dirtyRect); |
1656 } | 1657 } |
1657 | 1658 |
1658 const LayoutSize subPixelAccumulationIfNeeded = | 1659 const LayoutSize subPixelAccumulationIfNeeded = |
1659 offsetFromRoot ? subPixelAccumulation : LayoutSize(); | 1660 offsetFromRoot ? subPixelAccumulation : LayoutSize(); |
1660 for (; !iterator.atEnd(); iterator.advance()) { | 1661 for (; !iterator.atEnd(); iterator.advance()) { |
1661 PaintLayerFragment fragment; | 1662 PaintLayerFragment fragment; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1892 | 1893 |
1893 // Apply a transform if we have one. | 1894 // Apply a transform if we have one. |
1894 if (transform() && !appliedTransform) { | 1895 if (transform() && !appliedTransform) { |
1895 if (enclosingPaginationLayer()) | 1896 if (enclosingPaginationLayer()) |
1896 return hitTestTransformedLayerInFragments( | 1897 return hitTestTransformedLayerInFragments( |
1897 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, | 1898 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, |
1898 transformState, zOffset, clipRectsCacheSlot); | 1899 transformState, zOffset, clipRectsCacheSlot); |
1899 | 1900 |
1900 // Make sure the parent's clip rects have been calculated. | 1901 // Make sure the parent's clip rects have been calculated. |
1901 if (parent()) { | 1902 if (parent()) { |
1902 ClipRect clipRect = clipper(PaintLayer::DoNotUseGeometryMapper) | 1903 ClipRect clipRect; |
1903 .backgroundClipRect(ClipRectsContext( | 1904 clipper(PaintLayer::DoNotUseGeometryMapper) |
1904 rootLayer, clipRectsCacheSlot, | 1905 .calculateBackgroundClipRect( |
1905 ExcludeOverlayScrollbarSizeForHitTesting)); | 1906 ClipRectsContext(rootLayer, clipRectsCacheSlot, |
| 1907 ExcludeOverlayScrollbarSizeForHitTesting), |
| 1908 clipRect); |
1906 // Go ahead and test the enclosing clip now. | 1909 // Go ahead and test the enclosing clip now. |
1907 if (!clipRect.intersects(hitTestLocation)) | 1910 if (!clipRect.intersects(hitTestLocation)) |
1908 return nullptr; | 1911 return nullptr; |
1909 } | 1912 } |
1910 | 1913 |
1911 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, result, | 1914 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, result, |
1912 hitTestRect, hitTestLocation, | 1915 hitTestRect, hitTestLocation, |
1913 transformState, zOffset); | 1916 transformState, zOffset); |
1914 } | 1917 } |
1915 | 1918 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 const PaintLayerFragment& fragment = enclosingPaginationFragments.at(i); | 2137 const PaintLayerFragment& fragment = enclosingPaginationFragments.at(i); |
2135 | 2138 |
2136 // Apply the page/column clip for this fragment, as well as any clips | 2139 // Apply the page/column clip for this fragment, as well as any clips |
2137 // established by layers in between us and the enclosing pagination layer. | 2140 // established by layers in between us and the enclosing pagination layer. |
2138 LayoutRect clipRect = fragment.backgroundRect.rect(); | 2141 LayoutRect clipRect = fragment.backgroundRect.rect(); |
2139 | 2142 |
2140 // Now compute the clips within a given fragment | 2143 // Now compute the clips within a given fragment |
2141 if (parent() != enclosingPaginationLayer()) { | 2144 if (parent() != enclosingPaginationLayer()) { |
2142 enclosingPaginationLayer()->convertToLayerCoords( | 2145 enclosingPaginationLayer()->convertToLayerCoords( |
2143 rootLayer, offsetOfPaginationLayerFromRoot); | 2146 rootLayer, offsetOfPaginationLayerFromRoot); |
2144 LayoutRect parentClipRect = | 2147 |
2145 clipper(PaintLayer::DoNotUseGeometryMapper) | 2148 ClipRect parentClipRect; |
2146 .backgroundClipRect(ClipRectsContext( | 2149 clipper(PaintLayer::DoNotUseGeometryMapper) |
2147 enclosingPaginationLayer(), clipRectsCacheSlot, | 2150 .calculateBackgroundClipRect( |
2148 ExcludeOverlayScrollbarSizeForHitTesting)) | 2151 ClipRectsContext(enclosingPaginationLayer(), clipRectsCacheSlot, |
2149 .rect(); | 2152 ExcludeOverlayScrollbarSizeForHitTesting), |
| 2153 parentClipRect); |
| 2154 |
2150 parentClipRect.moveBy(fragment.paginationOffset + | 2155 parentClipRect.moveBy(fragment.paginationOffset + |
2151 offsetOfPaginationLayerFromRoot); | 2156 offsetOfPaginationLayerFromRoot); |
2152 clipRect.intersect(parentClipRect); | 2157 clipRect.intersect(parentClipRect.rect()); |
2153 } | 2158 } |
2154 | 2159 |
2155 if (!hitTestLocation.intersects(clipRect)) | 2160 if (!hitTestLocation.intersects(clipRect)) |
2156 continue; | 2161 continue; |
2157 | 2162 |
2158 PaintLayer* hitLayer = hitTestLayerByApplyingTransform( | 2163 PaintLayer* hitLayer = hitTestLayerByApplyingTransform( |
2159 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, | 2164 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, |
2160 transformState, zOffset, fragment.paginationOffset); | 2165 transformState, zOffset, fragment.paginationOffset); |
2161 if (hitLayer) | 2166 if (hitLayer) |
2162 return hitLayer; | 2167 return hitLayer; |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3227 } | 3232 } |
3228 | 3233 |
3229 void showLayerTree(const blink::LayoutObject* layoutObject) { | 3234 void showLayerTree(const blink::LayoutObject* layoutObject) { |
3230 if (!layoutObject) { | 3235 if (!layoutObject) { |
3231 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; | 3236 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; |
3232 return; | 3237 return; |
3233 } | 3238 } |
3234 showLayerTree(layoutObject->enclosingLayer()); | 3239 showLayerTree(layoutObject->enclosingLayer()); |
3235 } | 3240 } |
3236 #endif | 3241 #endif |
OLD | NEW |