Chromium Code Reviews| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 550 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { | 550 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { |
| 551 if (curr->renderer()->hasColumns()) { | 551 if (curr->renderer()->hasColumns()) { |
| 552 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox()); | 552 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox()); |
| 553 return; | 553 return; |
| 554 } | 554 } |
| 555 if (curr->stackingNode() == ancestorStackingContextNode) | 555 if (curr->stackingNode() == ancestorStackingContextNode) |
| 556 return; | 556 return; |
| 557 } | 557 } |
| 558 } | 558 } |
| 559 | 559 |
| 560 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer) | 560 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer, cons t InvalidationTreeWalkState* invalidationTreeWalkState) |
| 561 { | 561 { |
| 562 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping()) | 562 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping()) |
| 563 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer); | 563 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer, invalidationTreeWalkState); |
| 564 | 564 |
| 565 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la yer()->enclosingTransformedAncestor()->renderer(); | 565 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la yer()->enclosingTransformedAncestor()->renderer(); |
| 566 if (!transformedAncestor) | 566 if (!transformedAncestor) |
| 567 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer); | 567 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer, invalidationTreeWalkState); |
| 568 | 568 |
| 569 // If the transformedAncestor is actually the RenderView, we might get | 569 // If the transformedAncestor is actually the RenderView, we might get |
| 570 // confused and think that we can use LayoutState. Ideally, we'd made | 570 // confused and think that we can use LayoutState. Ideally, we'd made |
| 571 // LayoutState work for all composited layers as well, but until then | 571 // LayoutState work for all composited layers as well, but until then |
| 572 // we need to disable LayoutState for squashed layers. | 572 // we need to disable LayoutState for squashed layers. |
|
dsinclair
2014/07/02 18:48:24
Comment is out of date.
(We removed a very simila
| |
| 573 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | 573 ForceHorriblySlowRectMapping slowRectMapping(invalidationTreeWalkState); |
| 574 | 574 |
| 575 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor); | 575 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor, invalidationTreeWalkState); |
| 576 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor()); | 576 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor()); |
| 577 return point; | 577 return point; |
| 578 } | 578 } |
| 579 | 579 |
| 580 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect) | 580 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect) |
| 581 { | 581 { |
| 582 | |
| 583 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); | 582 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); |
| 584 if (!paintInvalidationLayer->groupedMapping()) { | 583 if (!paintInvalidationLayer->groupedMapping()) { |
| 585 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer()); | 584 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer()); |
| 586 return; | 585 return; |
| 587 } | 586 } |
| 588 | 587 |
| 589 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer(); | 588 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer(); |
| 590 if (!transformedAncestor) | 589 if (!transformedAncestor) |
| 591 return; | 590 return; |
| 592 | 591 |
| 593 // If the transformedAncestor is actually the RenderView, we might get | |
| 594 // confused and think that we can use LayoutState. Ideally, we'd made | |
| 595 // LayoutState work for all composited layers as well, but until then | |
| 596 // we need to disable LayoutState for squashed layers. | |
| 597 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); | |
| 598 | |
| 599 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the | 592 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the |
| 600 // transformed ancestor. | 593 // transformed ancestor. |
| 601 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox()); | 594 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox()); |
| 602 | 595 |
| 603 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor()); | 596 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor()); |
| 604 } | 597 } |
| 605 | 598 |
| 606 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect ) | 599 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect , const InvalidationTreeWalkState* invalidationTreeWalkState) |
| 607 { | 600 { |
| 608 if (!paintInvalidationContainer->layer()->groupedMapping()) { | 601 if (!paintInvalidationContainer->layer()->groupedMapping()) { |
| 609 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect); | 602 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect, invalidationTreeWalkState); |
| 610 return; | 603 return; |
| 611 } | 604 } |
| 612 | 605 |
| 613 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) | 606 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) |
| 614 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is | 607 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is |
| 615 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. | 608 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. |
| 616 // FIXME: remove this special-case code that works around the repainting cod e structure. | 609 // FIXME: remove this special-case code that works around the repainting cod e structure. |
| 617 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect); | 610 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, invalidationTreeWalkState); |
| 618 | 611 |
| 619 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct); | 612 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct); |
| 620 } | 613 } |
| 621 | 614 |
| 622 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer) | 615 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer, const InvalidationTreeWalk State* invalidationTreeWalkState) |
| 623 { | 616 { |
| 624 if (!paintInvalidationContainer->groupedMapping()) | 617 if (!paintInvalidationContainer->groupedMapping()) |
| 625 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer()); | 618 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer()); |
| 626 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer()); | 619 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer()); |
| 627 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect); | 620 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect, invalidationTreeWalkState); |
| 628 return rect; | 621 return rect; |
| 629 } | 622 } |
| 630 | 623 |
| 631 void RenderLayer::setHasVisibleContent() | 624 void RenderLayer::setHasVisibleContent() |
| 632 { | 625 { |
| 633 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { | 626 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { |
| 634 ASSERT(!parent() || parent()->hasVisibleDescendant()); | 627 ASSERT(!parent() || parent()->hasVisibleDescendant()); |
| 635 return; | 628 return; |
| 636 } | 629 } |
| 637 | 630 |
| (...skipping 3121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3759 } | 3752 } |
| 3760 } | 3753 } |
| 3761 | 3754 |
| 3762 void showLayerTree(const WebCore::RenderObject* renderer) | 3755 void showLayerTree(const WebCore::RenderObject* renderer) |
| 3763 { | 3756 { |
| 3764 if (!renderer) | 3757 if (!renderer) |
| 3765 return; | 3758 return; |
| 3766 showLayerTree(renderer->enclosingLayer()); | 3759 showLayerTree(renderer->enclosingLayer()); |
| 3767 } | 3760 } |
| 3768 #endif | 3761 #endif |
| OLD | NEW |