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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 545 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
546 if (curr->renderer()->hasColumns()) { | 546 if (curr->renderer()->hasColumns()) { |
547 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); | 547 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c
urr->renderBox()); |
548 return; | 548 return; |
549 } | 549 } |
550 if (curr->stackingNode() == ancestorStackingContextNode) | 550 if (curr->stackingNode() == ancestorStackingContextNode) |
551 return; | 551 return; |
552 } | 552 } |
553 } | 553 } |
554 | 554 |
555 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje
ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer) | 555 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje
ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer, cons
t PaintInvalidationState* paintInvalidationState) |
556 { | 556 { |
557 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro
upedMapping()) | 557 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro
upedMapping()) |
558 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); | 558 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer, paintInvalidationState); |
559 | 559 |
560 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); | 560 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la
yer()->enclosingTransformedAncestor()->renderer(); |
561 if (!transformedAncestor) | 561 if (!transformedAncestor) |
562 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer); | 562 return renderObject->positionFromPaintInvalidationContainer(paintInvalid
ationContainer, paintInvalidationState); |
563 | 563 |
564 // If the transformedAncestor is actually the RenderView, we might get | 564 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra
nsformedAncestor, paintInvalidationState); |
565 // confused and think that we can use LayoutState. Ideally, we'd made | |
566 // LayoutState work for all composited layers as well, but until then | |
567 // we need to disable LayoutState for squashed layers. | |
568 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | |
569 | |
570 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra
nsformedAncestor); | |
571 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi
ngOffsetFromTransformedAncestor()); | 565 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi
ngOffsetFromTransformedAncestor()); |
572 return point; | 566 return point; |
573 } | 567 } |
574 | 568 |
575 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect) | 569 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject*
paintInvalidationContainer, LayoutRect& rect) |
576 { | 570 { |
577 | |
578 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); | 571 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); |
579 if (!paintInvalidationLayer->groupedMapping()) { | 572 if (!paintInvalidationLayer->groupedMapping()) { |
580 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse
tInCompositingLayer()); | 573 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse
tInCompositingLayer()); |
581 return; | 574 return; |
582 } | 575 } |
583 | 576 |
584 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos
ingTransformedAncestor()->renderer(); | 577 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos
ingTransformedAncestor()->renderer(); |
585 if (!transformedAncestor) | 578 if (!transformedAncestor) |
586 return; | 579 return; |
587 | 580 |
588 // If the transformedAncestor is actually the RenderView, we might get | |
589 // confused and think that we can use LayoutState. Ideally, we'd made | |
590 // LayoutState work for all composited layers as well, but until then | |
591 // we need to disable LayoutState for squashed layers. | |
592 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | |
593 | |
594 // |repaintContainer| may have a local 2D transform on it, so take that into
account when mapping into the space of the | 581 // |repaintContainer| may have a local 2D transform on it, so take that into
account when mapping into the space of the |
595 // transformed ancestor. | 582 // transformed ancestor. |
596 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); | 583 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect
(rect), transformedAncestor).boundingBox()); |
597 | 584 |
598 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr
ansformedAncestor()); | 585 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr
ansformedAncestor()); |
599 } | 586 } |
600 | 587 |
601 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
) | 588 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb
ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect
, const PaintInvalidationState* paintInvalidationState) |
602 { | 589 { |
603 if (!paintInvalidationContainer->layer()->groupedMapping()) { | 590 if (!paintInvalidationContainer->layer()->groupedMapping()) { |
604 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect); | 591 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain
er, rect, paintInvalidationState); |
605 return; | 592 return; |
606 } | 593 } |
607 | 594 |
608 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) | 595 // This code adjusts the repaint rectangle to be in the space of the transfo
rmed ancestor of the grouped (i.e. squashed) |
609 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is | 596 // layer. This is because all layers that squash together need to repaint w.
r.t. a single container that is |
610 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. | 597 // an ancestor of all of them, in order to properly take into account any lo
cal transforms etc. |
611 // FIXME: remove this special-case code that works around the repainting cod
e structure. | 598 // FIXME: remove this special-case code that works around the repainting cod
e structure. |
612 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect); | 599 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer,
rect, paintInvalidationState); |
613 | 600 |
614 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re
ct); | 601 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re
ct); |
615 } | 602 } |
616 | 603 |
617 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer) | 604 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO
bject, const RenderLayer* paintInvalidationContainer, const PaintInvalidationSta
te* paintInvalidationState) |
618 { | 605 { |
619 if (!paintInvalidationContainer->groupedMapping()) | 606 if (!paintInvalidationContainer->groupedMapping()) |
620 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer()); | 607 return renderObject->computePaintInvalidationRect(paintInvalidationConta
iner->renderer()); |
621 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); | 608 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain
tInvalidationContainer->renderer()); |
622 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa
intInvalidationContainer->renderer(), rect); | 609 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa
intInvalidationContainer->renderer(), rect, paintInvalidationState); |
623 return rect; | 610 return rect; |
624 } | 611 } |
625 | 612 |
626 void RenderLayer::setHasVisibleContent() | 613 void RenderLayer::setHasVisibleContent() |
627 { | 614 { |
628 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { | 615 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { |
629 ASSERT(!parent() || parent()->hasVisibleDescendant()); | 616 ASSERT(!parent() || parent()->hasVisibleDescendant()); |
630 return; | 617 return; |
631 } | 618 } |
632 | 619 |
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3789 } | 3776 } |
3790 } | 3777 } |
3791 | 3778 |
3792 void showLayerTree(const WebCore::RenderObject* renderer) | 3779 void showLayerTree(const WebCore::RenderObject* renderer) |
3793 { | 3780 { |
3794 if (!renderer) | 3781 if (!renderer) |
3795 return; | 3782 return; |
3796 showLayerTree(renderer->enclosingLayer()); | 3783 showLayerTree(renderer->enclosingLayer()); |
3797 } | 3784 } |
3798 #endif | 3785 #endif |
OLD | NEW |