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 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); | 593 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); |
594 return; | 594 return; |
595 } | 595 } |
596 if (curr->stackingNode() == ancestorStackingContextNode) | 596 if (curr->stackingNode() == ancestorStackingContextNode) |
597 return; | 597 return; |
598 } | 598 } |
599 } | 599 } |
600 | 600 |
601 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje
ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer) | 601 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje
ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer) |
602 { | 602 { |
603 if (!paintInvalidationContainer || !paintInvalidationContainer->groupedMappi
ng()) | 603 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro
upedMapping()) |
604 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); | 604 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); |
605 | 605 |
606 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); | 606 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); |
607 if (!transformedAncestor) | 607 if (!transformedAncestor) |
608 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); | 608 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); |
609 | 609 |
610 // If the transformedAncestor is actually the RenderView, we might get | 610 // If the transformedAncestor is actually the RenderView, we might get |
611 // confused and think that we can use LayoutState. Ideally, we'd made | 611 // confused and think that we can use LayoutState. Ideally, we'd made |
612 // LayoutState work for all composited layers as well, but until then | 612 // LayoutState work for all composited layers as well, but until then |
613 // we need to disable LayoutState for squashed layers. | 613 // we need to disable LayoutState for squashed layers. |
614 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | 614 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); |
615 | 615 |
616 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra
nsformedAncestor); | 616 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra
nsformedAncestor); |
617 point.moveBy(-paintInvalidationContainer->groupedMapping()->squashingOffsetF
romTransformedAncestor()); | 617 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi
ngOffsetFromTransformedAncestor()); |
618 return point; | 618 return point; |
619 } | 619 } |
620 | 620 |
621 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
) | 621 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
) |
622 { | 622 { |
623 if (!paintInvalidationContainer->groupedMapping()) { | 623 if (!paintInvalidationContainer->layer()->groupedMapping()) { |
624 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect); | 624 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect); |
625 return; | 625 return; |
626 } | 626 } |
627 | 627 |
628 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); | 628 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); |
629 if (!transformedAncestor) | 629 if (!transformedAncestor) |
630 return; | 630 return; |
631 | 631 |
632 // If the transformedAncestor is actually the RenderView, we might get | 632 // If the transformedAncestor is actually the RenderView, we might get |
633 // confused and think that we can use LayoutState. Ideally, we'd made | 633 // confused and think that we can use LayoutState. Ideally, we'd made |
634 // LayoutState work for all composited layers as well, but until then | 634 // LayoutState work for all composited layers as well, but until then |
635 // we need to disable LayoutState for squashed layers. | 635 // we need to disable LayoutState for squashed layers. |
636 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | 636 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); |
637 | 637 |
638 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) | 638 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) |
639 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is | 639 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is |
640 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. | 640 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. |
641 // FIXME: remove this special-case code that works around the repainting cod
e structure. | 641 // FIXME: remove this special-case code that works around the repainting cod
e structure. |
642 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect); | 642 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect); |
643 | 643 |
644 // |repaintContainer| may have a local 2D transform on it, so take that into
account when mapping into the space of the | 644 // |repaintContainer| may have a local 2D transform on it, so take that into
account when mapping into the space of the |
645 // transformed ancestor. | 645 // transformed ancestor. |
646 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); | 646 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); |
647 | 647 |
648 rect.moveBy(-paintInvalidationContainer->groupedMapping()->squashingOffsetFr
omTransformedAncestor()); | 648 rect.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashin
gOffsetFromTransformedAncestor()); |
649 } | 649 } |
650 | 650 |
651 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer) | 651 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer) |
652 { | 652 { |
653 if (!paintInvalidationContainer->groupedMapping()) | 653 if (!paintInvalidationContainer->groupedMapping()) |
654 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer()); | 654 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer()); |
655 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); | 655 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); |
656 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa
intInvalidationContainer->renderer(), rect); | 656 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa
intInvalidationContainer->renderer(), rect); |
657 return rect; | 657 return rect; |
658 } | 658 } |
(...skipping 3106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3765 } | 3765 } |
3766 } | 3766 } |
3767 | 3767 |
3768 void showLayerTree(const WebCore::RenderObject* renderer) | 3768 void showLayerTree(const WebCore::RenderObject* renderer) |
3769 { | 3769 { |
3770 if (!renderer) | 3770 if (!renderer) |
3771 return; | 3771 return; |
3772 showLayerTree(renderer->enclosingLayer()); | 3772 showLayerTree(renderer->enclosingLayer()); |
3773 } | 3773 } |
3774 #endif | 3774 #endif |
OLD | NEW |