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 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 { | 1380 { |
1381 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->scrollCorner() || layoutObject()->style()->resize() != RESIZE_NONE); | 1381 return m_scrollableArea && (m_scrollableArea->hasScrollbar() || m_scrollable
Area->scrollCorner() || layoutObject()->style()->resize() != RESIZE_NONE); |
1382 } | 1382 } |
1383 | 1383 |
1384 void DeprecatedPaintLayer::appendSingleFragmentIgnoringPagination(DeprecatedPain
tLayerFragments& fragments, const DeprecatedPaintLayer* rootLayer, const LayoutR
ect& dirtyRect, ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelev
ancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowC
lip, const LayoutPoint* offsetFromRoot, const LayoutSize& subPixelAccumulation) | 1384 void DeprecatedPaintLayer::appendSingleFragmentIgnoringPagination(DeprecatedPain
tLayerFragments& fragments, const DeprecatedPaintLayer* rootLayer, const LayoutR
ect& dirtyRect, ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelev
ancy inOverlayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowC
lip, const LayoutPoint* offsetFromRoot, const LayoutSize& subPixelAccumulation) |
1385 { | 1385 { |
1386 DeprecatedPaintLayerFragment fragment; | 1386 DeprecatedPaintLayerFragment fragment; |
1387 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverlaySc
rollbarSizeRelevancy, subPixelAccumulation); | 1387 ClipRectsContext clipRectsContext(rootLayer, clipRectsCacheSlot, inOverlaySc
rollbarSizeRelevancy, subPixelAccumulation); |
1388 if (respectOverflowClip == IgnoreOverflowClip) | 1388 if (respectOverflowClip == IgnoreOverflowClip) |
1389 clipRectsContext.setIgnoreOverflowClip(); | 1389 clipRectsContext.setIgnoreOverflowClip(); |
1390 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds,
fragment.backgroundRect, fragment.foregroundRect, fragment.outlineRect, offsetFr
omRoot); | 1390 clipper().calculateRects(clipRectsContext, dirtyRect, fragment.layerBounds,
fragment.backgroundRect, fragment.foregroundRect, offsetFromRoot); |
1391 fragments.append(fragment); | 1391 fragments.append(fragment); |
1392 } | 1392 } |
1393 | 1393 |
1394 void DeprecatedPaintLayer::collectFragments(DeprecatedPaintLayerFragments& fragm
ents, const DeprecatedPaintLayer* rootLayer, const LayoutRect& dirtyRect, | 1394 void DeprecatedPaintLayer::collectFragments(DeprecatedPaintLayerFragments& fragm
ents, const DeprecatedPaintLayer* rootLayer, const LayoutRect& dirtyRect, |
1395 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelevancy inOverl
ayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const L
ayoutPoint* offsetFromRoot, | 1395 ClipRectsCacheSlot clipRectsCacheSlot, OverlayScrollbarSizeRelevancy inOverl
ayScrollbarSizeRelevancy, ShouldRespectOverflowClip respectOverflowClip, const L
ayoutPoint* offsetFromRoot, |
1396 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) | 1396 const LayoutSize& subPixelAccumulation, const LayoutRect* layerBoundingBox) |
1397 { | 1397 { |
1398 if (!enclosingPaginationLayer()) { | 1398 if (!enclosingPaginationLayer()) { |
1399 // For unpaginated layers, there is only one fragment. | 1399 // For unpaginated layers, there is only one fragment. |
1400 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect,
clipRectsCacheSlot, inOverlayScrollbarSizeRelevancy, respectOverflowClip, offset
FromRoot, subPixelAccumulation); | 1400 appendSingleFragmentIgnoringPagination(fragments, rootLayer, dirtyRect,
clipRectsCacheSlot, inOverlayScrollbarSizeRelevancy, respectOverflowClip, offset
FromRoot, subPixelAccumulation); |
1401 return; | 1401 return; |
1402 } | 1402 } |
1403 | 1403 |
1404 // Compute our offset within the enclosing pagination layer. | 1404 // Compute our offset within the enclosing pagination layer. |
1405 LayoutPoint offsetWithinPaginatedLayer; | 1405 LayoutPoint offsetWithinPaginatedLayer; |
1406 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; | 1406 convertToLayerCoords(enclosingPaginationLayer(), offsetWithinPaginatedLayer)
; |
1407 | 1407 |
1408 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate | 1408 // Calculate clip rects relative to the enclosingPaginationLayer. The purpos
e of this call is to determine our bounds clipped to intermediate |
1409 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. | 1409 // layers between us and the pagination context. It's important to minimize
the number of fragments we need to create and this helps with that. |
1410 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsCacheSlot, inOverlayScrollbarSizeRelevancy); | 1410 ClipRectsContext paginationClipRectsContext(enclosingPaginationLayer(), clip
RectsCacheSlot, inOverlayScrollbarSizeRelevancy); |
1411 if (respectOverflowClip == IgnoreOverflowClip) | 1411 if (respectOverflowClip == IgnoreOverflowClip) |
1412 paginationClipRectsContext.setIgnoreOverflowClip(); | 1412 paginationClipRectsContext.setIgnoreOverflowClip(); |
1413 LayoutRect layerBoundsInFlowThread; | 1413 LayoutRect layerBoundsInFlowThread; |
1414 ClipRect backgroundRectInFlowThread; | 1414 ClipRect backgroundRectInFlowThread; |
1415 ClipRect foregroundRectInFlowThread; | 1415 ClipRect foregroundRectInFlowThread; |
1416 ClipRect outlineRectInFlowThread; | 1416 clipper().calculateRects(paginationClipRectsContext, LayoutRect(LayoutRect::
infiniteIntRect()), layerBoundsInFlowThread, |
1417 clipper().calculateRects(paginationClipRectsContext, LayoutRect(LayoutRect::
infiniteIntRect()), layerBoundsInFlowThread, backgroundRectInFlowThread, foregro
undRectInFlowThread, | 1417 backgroundRectInFlowThread, foregroundRectInFlowThread, &offsetWithinPag
inatedLayer); |
1418 outlineRectInFlowThread, &offsetWithinPaginatedLayer); | |
1419 | 1418 |
1420 // Take our bounding box within the flow thread and clip it. | 1419 // Take our bounding box within the flow thread and clip it. |
1421 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : physicalBoundingBox(offsetWithinPaginatedLayer); | 1420 LayoutRect layerBoundingBoxInFlowThread = layerBoundingBox ? *layerBoundingB
ox : physicalBoundingBox(offsetWithinPaginatedLayer); |
1422 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); | 1421 layerBoundingBoxInFlowThread.intersect(backgroundRectInFlowThread.rect()); |
1423 | 1422 |
1424 // Make the dirty rect relative to the fragmentation context (multicol conta
iner, etc.). | 1423 // Make the dirty rect relative to the fragmentation context (multicol conta
iner, etc.). |
1425 LayoutFlowThread* enclosingFlowThread = toLayoutFlowThread(enclosingPaginati
onLayer()->layoutObject()); | 1424 LayoutFlowThread* enclosingFlowThread = toLayoutFlowThread(enclosingPaginati
onLayer()->layoutObject()); |
1426 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root
layer to the nearest fragmentation context. | 1425 LayoutPoint offsetOfPaginationLayerFromRoot; // Visual offset from the root
layer to the nearest fragmentation context. |
1427 bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer(
) == enclosingPaginationLayer(); | 1426 bool rootLayerIsInsidePaginationLayer = rootLayer->enclosingPaginationLayer(
) == enclosingPaginationLayer(); |
1428 if (rootLayerIsInsidePaginationLayer) { | 1427 if (rootLayerIsInsidePaginationLayer) { |
(...skipping 24 matching lines...) Expand all Loading... |
1453 if (rootLayerIsInsidePaginationLayer) | 1452 if (rootLayerIsInsidePaginationLayer) |
1454 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto
rLayer)); | 1453 ancestorClipRect.moveBy(-rootLayer->visualOffsetFromAncestor(ancesto
rLayer)); |
1455 ancestorClipRect.intersect(dirtyRect); | 1454 ancestorClipRect.intersect(dirtyRect); |
1456 } | 1455 } |
1457 | 1456 |
1458 const LayoutSize subPixelAccumulationIfNeeded = offsetFromRoot ? subPixelAcc
umulation : LayoutSize(); | 1457 const LayoutSize subPixelAccumulationIfNeeded = offsetFromRoot ? subPixelAcc
umulation : LayoutSize(); |
1459 for (size_t i = 0; i < fragments.size(); ++i) { | 1458 for (size_t i = 0; i < fragments.size(); ++i) { |
1460 DeprecatedPaintLayerFragment& fragment = fragments.at(i); | 1459 DeprecatedPaintLayerFragment& fragment = fragments.at(i); |
1461 | 1460 |
1462 // Set our four rects with all clipping applied that was internal to the
flow thread. | 1461 // Set our four rects with all clipping applied that was internal to the
flow thread. |
1463 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread, outlineRectInFlowThread); | 1462 fragment.setRects(layerBoundsInFlowThread, backgroundRectInFlowThread, f
oregroundRectInFlowThread); |
1464 | 1463 |
1465 // Shift to the root-relative physical position used when painting the f
low thread in this fragment. | 1464 // Shift to the root-relative physical position used when painting the f
low thread in this fragment. |
1466 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR
oot + subPixelAccumulationIfNeeded); | 1465 fragment.moveBy(fragment.paginationOffset + offsetOfPaginationLayerFromR
oot + subPixelAccumulationIfNeeded); |
1467 | 1466 |
1468 // Intersect the fragment with our ancestor's background clip so that e.
g., columns in an overflow:hidden block are | 1467 // Intersect the fragment with our ancestor's background clip so that e.
g., columns in an overflow:hidden block are |
1469 // properly clipped by the overflow. | 1468 // properly clipped by the overflow. |
1470 fragment.intersect(ancestorClipRect.rect()); | 1469 fragment.intersect(ancestorClipRect.rect()); |
1471 | 1470 |
1472 // Now intersect with our pagination clip. This will typically mean we'r
e just intersecting the dirty rect with the column | 1471 // Now intersect with our pagination clip. This will typically mean we'r
e just intersecting the dirty rect with the column |
1473 // clip, so the column clip ends up being all we apply. | 1472 // clip, so the column clip ends up being all we apply. |
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2716 | 2715 |
2717 void showLayerTree(const blink::LayoutObject* layoutObject) | 2716 void showLayerTree(const blink::LayoutObject* layoutObject) |
2718 { | 2717 { |
2719 if (!layoutObject) { | 2718 if (!layoutObject) { |
2720 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2719 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2721 return; | 2720 return; |
2722 } | 2721 } |
2723 showLayerTree(layoutObject->enclosingLayer()); | 2722 showLayerTree(layoutObject->enclosingLayer()); |
2724 } | 2723 } |
2725 #endif | 2724 #endif |
OLD | NEW |