OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1558 clipper().calculateRects(paginationClipRectsContext, LayoutRect::infiniteInt
Rect(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlo
wThread, | 1558 clipper().calculateRects(paginationClipRectsContext, LayoutRect::infiniteInt
Rect(), layerBoundsInFlowThread, backgroundRectInFlowThread, foregroundRectInFlo
wThread, |
1559 outlineRectInFlowThread, &offsetWithinPaginatedLayer); | 1559 outlineRectInFlowThread, &offsetWithinPaginatedLayer); |
1560 | 1560 |
1561 // Take our bounding box within the flow thread and clip it. | 1561 // Take our bounding box within the flow thread and clip it. |
1562 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer
); | 1562 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : physicalBoundingBox(enclosingPaginationLayer(), &offsetWithinPaginatedLayer
); |
1563 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); | 1563 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
1564 | 1564 |
1565 // Make the dirty rect relative to the fragmentation context (multicol conta
iner, etc.). | 1565 // Make the dirty rect relative to the fragmentation context (multicol conta
iner, etc.). |
1566 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); | 1566 RenderFlowThread* enclosingFlowThread = toRenderFlowThread(enclosingPaginati
onLayer()->renderer()); |
1567 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root
layer to the nearest fragmentation context. | 1567 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root
layer to the nearest fragmentation context. |
1568 if (rootLayer->enclosingPaginationLayer() == enclosingPaginationLayer()) { | 1568 bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer(
) == enclosingPaginationLayer(); |
| 1569 if (rootLayerIsInsidePaginationLayer) { |
1569 // The root layer is in the same fragmentation context as this layer, so
we need to look | 1570 // The root layer is in the same fragmentation context as this layer, so
we need to look |
1570 // inside it and subtract the offset between the fragmentation context a
nd the root layer. | 1571 // inside it and subtract the offset between the fragmentation context a
nd the root layer. |
1571 offsetOfPaginationLayerFromRoot = -rootLayer->visualOffsetFromAncestor(e
nclosingPaginationLayer()); | 1572 offsetOfPaginationLayerFromRoot = -rootLayer->visualOffsetFromAncestor(e
nclosingPaginationLayer()); |
1572 } else { | 1573 } else { |
1573 offsetOfPaginationLayerFromRoot = enclosingPaginationLayer()->visualOffs
etFromAncestor(rootLayer); | 1574 offsetOfPaginationLayerFromRoot = enclosingPaginationLayer()->visualOffs
etFromAncestor(rootLayer); |
1574 } | 1575 } |
1575 LayoutRect dirtyRectInFlowThread(dirtyRect); | 1576 LayoutRect dirtyRectInFlowThread(dirtyRect); |
1576 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); | 1577 dirtyRectInFlowThread.moveBy(-offsetOfPaginationLayerFromRoot); |
1577 | 1578 |
1578 // Tell the flow thread to collect the fragments. We pass enough information
to create a minimal number of fragments based off the pages/columns | 1579 // Tell the flow thread to collect the fragments. We pass enough information
to create a minimal number of fragments based off the pages/columns |
1579 // that intersect the actual dirtyRect as well as the pages/columns that int
ersect our layer's bounding box. | 1580 // that intersect the actual dirtyRect as well as the pages/columns that int
ersect our layer's bounding box. |
1580 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow
Thread, dirtyRectInFlowThread); | 1581 enclosingFlowThread->collectLayerFragments(fragments, layerBoundingBoxInFlow
Thread, dirtyRectInFlowThread); |
1581 | 1582 |
1582 if (fragments.isEmpty()) | 1583 if (fragments.isEmpty()) |
1583 return; | 1584 return; |
1584 | 1585 |
1585 // Get the parent clip rects of the pagination layer, since we need to inter
sect with that when painting column contents. | 1586 // Get the parent clip rects of the pagination layer, since we need to inter
sect with that when painting column contents. |
1586 ClipRect ancestorClipRect = dirtyRect; | 1587 ClipRect ancestorClipRect = dirtyRect; |
1587 if (enclosingPaginationLayer()->parent()) { | 1588 if (const RenderLayer* paginationParentLayer = enclosingPaginationLayer()->p
arent()) { |
1588 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverl
ayScrollbarSizeRelevancy); | 1589 const RenderLayer* ancestorLayer = rootLayerIsInsidePaginationLayer ? pa
ginationParentLayer : rootLayer; |
| 1590 ClipRectsContext clipRectsContext(ancestorLayer, clipRectsCacheSlot, inO
verlayScrollbarSizeRelevancy); |
1589 if (respectOverflowClip == IgnoreOverflowClip) | 1591 if (respectOverflowClip == IgnoreOverflowClip) |
1590 clipRectsContext.setIgnoreOverflowClip(); | 1592 clipRectsContext.setIgnoreOverflowClip(); |
1591 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR
ect(clipRectsContext); | 1593 ancestorClipRect = enclosingPaginationLayer()->clipper().backgroundClipR
ect(clipRectsContext); |
| 1594 if (rootLayerIsInsidePaginationLayer) |
| 1595 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto
rLayer)); |
1592 ancestorClipRect.intersect(dirtyRect); | 1596 ancestorClipRect.intersect(dirtyRect); |
1593 } | 1597 } |
1594 | 1598 |
1595 for (size_t i = 0; i < fragments.size(); ++i) { | 1599 for (size_t i = 0; i < fragments.size(); ++i) { |
1596 LayerFragment& fragment = fragments.at(i); | 1600 LayerFragment& fragment = fragments.at(i); |
1597 | 1601 |
1598 // Set our four rects with all clipping applied that was internal to the
flow thread. | 1602 // Set our four rects with all clipping applied that was internal to the
flow thread. |
1599 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); | 1603 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); |
1600 | 1604 |
1601 // Shift to the root-relative physical position used when painting the f
low thread in this fragment. | 1605 // Shift to the root-relative physical position used when painting the f
low thread in this fragment. |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 } | 2910 } |
2907 } | 2911 } |
2908 | 2912 |
2909 void showLayerTree(const blink::RenderObject* renderer) | 2913 void showLayerTree(const blink::RenderObject* renderer) |
2910 { | 2914 { |
2911 if (!renderer) | 2915 if (!renderer) |
2912 return; | 2916 return; |
2913 showLayerTree(renderer->enclosingLayer()); | 2917 showLayerTree(renderer->enclosingLayer()); |
2914 } | 2918 } |
2915 #endif | 2919 #endif |
OLD | NEW |