Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 360833002: Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT-ed Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) { 553 for (RenderLayer* curr = parent(); curr; curr = curr->parent()) {
554 if (curr->renderer()->hasColumns()) { 554 if (curr->renderer()->hasColumns()) {
555 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox()); 555 m_isPaginated = checkContainingBlockChainForPagination(renderer(), c urr->renderBox());
556 return; 556 return;
557 } 557 }
558 if (curr->stackingNode() == ancestorStackingContextNode) 558 if (curr->stackingNode() == ancestorStackingContextNode)
559 return; 559 return;
560 } 560 }
561 } 561 }
562 562
563 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer) 563 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer, cons t InvalidationTreeWalkState* invalidationTreeWalkState)
564 { 564 {
565 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping()) 565 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping())
566 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer); 566 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer, invalidationTreeWalkState);
567 567
568 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la yer()->enclosingTransformedAncestor()->renderer(); 568 RenderLayerModelObject* transformedAncestor = paintInvalidationContainer->la yer()->enclosingTransformedAncestor()->renderer();
569 if (!transformedAncestor) 569 if (!transformedAncestor)
570 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer); 570 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer, invalidationTreeWalkState);
571 571
572 // If the transformedAncestor is actually the RenderView, we might get 572 // If the transformedAncestor is actually the RenderView, we might get
573 // confused and think that we can use LayoutState. Ideally, we'd made 573 // confused and think that we can use LayoutState. Ideally, we'd made
574 // LayoutState work for all composited layers as well, but until then 574 // LayoutState work for all composited layers as well, but until then
575 // we need to disable LayoutState for squashed layers. 575 // we need to disable LayoutState for squashed layers.
576 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor); 576 ForceHorriblySlowRectMapping slowRectMapping(invalidationTreeWalkState);
577 577
578 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor); 578 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor, invalidationTreeWalkState);
579 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor()); 579 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor());
580 return point; 580 return point;
581 } 581 }
582 582
583 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect) 583 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
584 { 584 {
585
586 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); 585 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
587 if (!paintInvalidationLayer->groupedMapping()) { 586 if (!paintInvalidationLayer->groupedMapping()) {
588 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer()); 587 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer());
589 return; 588 return;
590 } 589 }
591 590
592 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer(); 591 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer();
593 if (!transformedAncestor) 592 if (!transformedAncestor)
594 return; 593 return;
595 594
596 // If the transformedAncestor is actually the RenderView, we might get
597 // confused and think that we can use LayoutState. Ideally, we'd made
598 // LayoutState work for all composited layers as well, but until then
599 // we need to disable LayoutState for squashed layers.
600 ForceHorriblySlowRectMapping slowRectMapping(*transformedAncestor);
601
602 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the 595 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
603 // transformed ancestor. 596 // transformed ancestor.
604 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox()); 597 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox());
605 598
606 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor()); 599 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor());
607 } 600 }
608 601
609 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect ) 602 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect , const InvalidationTreeWalkState* invalidationTreeWalkState)
610 { 603 {
611 if (!paintInvalidationContainer->layer()->groupedMapping()) { 604 if (!paintInvalidationContainer->layer()->groupedMapping()) {
612 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect); 605 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect, invalidationTreeWalkState);
613 return; 606 return;
614 } 607 }
615 608
616 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) 609 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed)
617 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is 610 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is
618 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. 611 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc.
619 // FIXME: remove this special-case code that works around the repainting cod e structure. 612 // FIXME: remove this special-case code that works around the repainting cod e structure.
620 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect); 613 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, invalidationTreeWalkState);
621 614
622 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct); 615 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct);
623 } 616 }
624 617
625 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer) 618 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer, const InvalidationTreeWalk State* invalidationTreeWalkState)
626 { 619 {
627 if (!paintInvalidationContainer->groupedMapping()) 620 if (!paintInvalidationContainer->groupedMapping())
628 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer()); 621 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer());
629 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer()); 622 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer());
630 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect); 623 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect, invalidationTreeWalkState);
631 return rect; 624 return rect;
632 } 625 }
633 626
634 void RenderLayer::setHasVisibleContent() 627 void RenderLayer::setHasVisibleContent()
635 { 628 {
636 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { 629 if (m_hasVisibleContent && !m_visibleContentStatusDirty) {
637 ASSERT(!parent() || parent()->hasVisibleDescendant()); 630 ASSERT(!parent() || parent()->hasVisibleDescendant());
638 return; 631 return;
639 } 632 }
640 633
(...skipping 3107 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 } 3741 }
3749 } 3742 }
3750 3743
3751 void showLayerTree(const WebCore::RenderObject* renderer) 3744 void showLayerTree(const WebCore::RenderObject* renderer)
3752 { 3745 {
3753 if (!renderer) 3746 if (!renderer)
3754 return; 3747 return;
3755 showLayerTree(renderer->enclosingLayer()); 3748 showLayerTree(renderer->enclosingLayer());
3756 } 3749 }
3757 #endif 3750 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698