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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 2743733004: Revert of Reduce copying of local data structures in GeometryMapper and PaintLayerClipper. (Closed)
Patch Set: Created 3 years, 9 months 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
OLDNEW
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
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 1649 ancestorClipRect = enclosingPaginationLayer()
1650 enclosingPaginationLayer() 1650 ->clipper(geometryMapperOption)
1651 ->clipper(geometryMapperOption) 1651 .backgroundClipRect(clipRectsContext);
1652 .calculateBackgroundClipRect(clipRectsContext, ancestorClipRect);
1653 if (rootLayerIsInsidePaginationLayer) 1652 if (rootLayerIsInsidePaginationLayer)
1654 ancestorClipRect.moveBy( 1653 ancestorClipRect.moveBy(
1655 -rootLayer->visualOffsetFromAncestor(ancestorLayer)); 1654 -rootLayer->visualOffsetFromAncestor(ancestorLayer));
1656 ancestorClipRect.intersect(dirtyRect); 1655 ancestorClipRect.intersect(dirtyRect);
1657 } 1656 }
1658 1657
1659 const LayoutSize subPixelAccumulationIfNeeded = 1658 const LayoutSize subPixelAccumulationIfNeeded =
1660 offsetFromRoot ? subPixelAccumulation : LayoutSize(); 1659 offsetFromRoot ? subPixelAccumulation : LayoutSize();
1661 for (; !iterator.atEnd(); iterator.advance()) { 1660 for (; !iterator.atEnd(); iterator.advance()) {
1662 PaintLayerFragment fragment; 1661 PaintLayerFragment fragment;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1893 1892
1894 // Apply a transform if we have one. 1893 // Apply a transform if we have one.
1895 if (transform() && !appliedTransform) { 1894 if (transform() && !appliedTransform) {
1896 if (enclosingPaginationLayer()) 1895 if (enclosingPaginationLayer())
1897 return hitTestTransformedLayerInFragments( 1896 return hitTestTransformedLayerInFragments(
1898 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, 1897 rootLayer, containerLayer, result, hitTestRect, hitTestLocation,
1899 transformState, zOffset, clipRectsCacheSlot); 1898 transformState, zOffset, clipRectsCacheSlot);
1900 1899
1901 // Make sure the parent's clip rects have been calculated. 1900 // Make sure the parent's clip rects have been calculated.
1902 if (parent()) { 1901 if (parent()) {
1903 ClipRect clipRect; 1902 ClipRect clipRect = clipper(PaintLayer::DoNotUseGeometryMapper)
1904 clipper(PaintLayer::DoNotUseGeometryMapper) 1903 .backgroundClipRect(ClipRectsContext(
1905 .calculateBackgroundClipRect( 1904 rootLayer, clipRectsCacheSlot,
1906 ClipRectsContext(rootLayer, clipRectsCacheSlot, 1905 ExcludeOverlayScrollbarSizeForHitTesting));
1907 ExcludeOverlayScrollbarSizeForHitTesting),
1908 clipRect);
1909 // Go ahead and test the enclosing clip now. 1906 // Go ahead and test the enclosing clip now.
1910 if (!clipRect.intersects(hitTestLocation)) 1907 if (!clipRect.intersects(hitTestLocation))
1911 return nullptr; 1908 return nullptr;
1912 } 1909 }
1913 1910
1914 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, result, 1911 return hitTestLayerByApplyingTransform(rootLayer, containerLayer, result,
1915 hitTestRect, hitTestLocation, 1912 hitTestRect, hitTestLocation,
1916 transformState, zOffset); 1913 transformState, zOffset);
1917 } 1914 }
1918 1915
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
2137 const PaintLayerFragment& fragment = enclosingPaginationFragments.at(i); 2134 const PaintLayerFragment& fragment = enclosingPaginationFragments.at(i);
2138 2135
2139 // Apply the page/column clip for this fragment, as well as any clips 2136 // Apply the page/column clip for this fragment, as well as any clips
2140 // established by layers in between us and the enclosing pagination layer. 2137 // established by layers in between us and the enclosing pagination layer.
2141 LayoutRect clipRect = fragment.backgroundRect.rect(); 2138 LayoutRect clipRect = fragment.backgroundRect.rect();
2142 2139
2143 // Now compute the clips within a given fragment 2140 // Now compute the clips within a given fragment
2144 if (parent() != enclosingPaginationLayer()) { 2141 if (parent() != enclosingPaginationLayer()) {
2145 enclosingPaginationLayer()->convertToLayerCoords( 2142 enclosingPaginationLayer()->convertToLayerCoords(
2146 rootLayer, offsetOfPaginationLayerFromRoot); 2143 rootLayer, offsetOfPaginationLayerFromRoot);
2147 2144 LayoutRect parentClipRect =
2148 ClipRect parentClipRect; 2145 clipper(PaintLayer::DoNotUseGeometryMapper)
2149 clipper(PaintLayer::DoNotUseGeometryMapper) 2146 .backgroundClipRect(ClipRectsContext(
2150 .calculateBackgroundClipRect( 2147 enclosingPaginationLayer(), clipRectsCacheSlot,
2151 ClipRectsContext(enclosingPaginationLayer(), clipRectsCacheSlot, 2148 ExcludeOverlayScrollbarSizeForHitTesting))
2152 ExcludeOverlayScrollbarSizeForHitTesting), 2149 .rect();
2153 parentClipRect);
2154
2155 parentClipRect.moveBy(fragment.paginationOffset + 2150 parentClipRect.moveBy(fragment.paginationOffset +
2156 offsetOfPaginationLayerFromRoot); 2151 offsetOfPaginationLayerFromRoot);
2157 clipRect.intersect(parentClipRect.rect()); 2152 clipRect.intersect(parentClipRect);
2158 } 2153 }
2159 2154
2160 if (!hitTestLocation.intersects(clipRect)) 2155 if (!hitTestLocation.intersects(clipRect))
2161 continue; 2156 continue;
2162 2157
2163 PaintLayer* hitLayer = hitTestLayerByApplyingTransform( 2158 PaintLayer* hitLayer = hitTestLayerByApplyingTransform(
2164 rootLayer, containerLayer, result, hitTestRect, hitTestLocation, 2159 rootLayer, containerLayer, result, hitTestRect, hitTestLocation,
2165 transformState, zOffset, fragment.paginationOffset); 2160 transformState, zOffset, fragment.paginationOffset);
2166 if (hitLayer) 2161 if (hitLayer)
2167 return hitLayer; 2162 return hitLayer;
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after
3232 } 3227 }
3233 3228
3234 void showLayerTree(const blink::LayoutObject* layoutObject) { 3229 void showLayerTree(const blink::LayoutObject* layoutObject) {
3235 if (!layoutObject) { 3230 if (!layoutObject) {
3236 LOG(INFO) << "Cannot showLayerTree. Root is (nil)"; 3231 LOG(INFO) << "Cannot showLayerTree. Root is (nil)";
3237 return; 3232 return;
3238 } 3233 }
3239 showLayerTree(layoutObject->enclosingLayer()); 3234 showLayerTree(layoutObject->enclosingLayer());
3240 } 3235 }
3241 #endif 3236 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintInvalidator.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerClipper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698