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

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

Issue 379073002: Revert of Divorce PaintInvalidationState from LayoutState (https://codereview.chromium.org/36083300… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Correct revert order 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
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderListBox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
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, cons t PaintInvalidationState* paintInvalidationState) 555 LayoutPoint RenderLayer::positionFromPaintInvalidationContainer(const RenderObje ct* renderObject, const RenderLayerModelObject* paintInvalidationContainer)
556 { 556 {
557 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping()) 557 if (!paintInvalidationContainer || !paintInvalidationContainer->layer()->gro upedMapping())
558 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer, paintInvalidationState); 558 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer);
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, paintInvalidationState); 562 return renderObject->positionFromPaintInvalidationContainer(paintInvalid ationContainer);
563 563
564 LayoutPoint point = renderObject->positionFromPaintInvalidationContainer(tra nsformedAncestor, paintInvalidationState); 564 // If the transformedAncestor is actually the RenderView, we might get
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);
565 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor()); 571 point.moveBy(-paintInvalidationContainer->layer()->groupedMapping()->squashi ngOffsetFromTransformedAncestor());
566 return point; 572 return point;
567 } 573 }
568 574
569 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect) 575 void RenderLayer::mapRectToPaintBackingCoordinates(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect)
570 { 576 {
577
571 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); 578 RenderLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
572 if (!paintInvalidationLayer->groupedMapping()) { 579 if (!paintInvalidationLayer->groupedMapping()) {
573 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer()); 580 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer());
574 return; 581 return;
575 } 582 }
576 583
577 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer(); 584 RenderLayerModelObject* transformedAncestor = paintInvalidationLayer->enclos ingTransformedAncestor()->renderer();
578 if (!transformedAncestor) 585 if (!transformedAncestor)
579 return; 586 return;
580 587
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
581 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the 594 // |repaintContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
582 // transformed ancestor. 595 // transformed ancestor.
583 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox()); 596 rect = LayoutRect(paintInvalidationContainer->localToContainerQuad(FloatRect (rect), transformedAncestor).boundingBox());
584 597
585 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor()); 598 rect.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromTr ansformedAncestor());
586 } 599 }
587 600
588 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect , const PaintInvalidationState* paintInvalidationState) 601 void RenderLayer::mapRectToPaintInvalidationBacking(const RenderObject* renderOb ject, const RenderLayerModelObject* paintInvalidationContainer, LayoutRect& rect )
589 { 602 {
590 if (!paintInvalidationContainer->layer()->groupedMapping()) { 603 if (!paintInvalidationContainer->layer()->groupedMapping()) {
591 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect, paintInvalidationState); 604 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContain er, rect);
592 return; 605 return;
593 } 606 }
594 607
595 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed) 608 // This code adjusts the repaint rectangle to be in the space of the transfo rmed ancestor of the grouped (i.e. squashed)
596 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is 609 // layer. This is because all layers that squash together need to repaint w. r.t. a single container that is
597 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. 610 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc.
598 // FIXME: remove this special-case code that works around the repainting cod e structure. 611 // FIXME: remove this special-case code that works around the repainting cod e structure.
599 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState); 612 renderObject->mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect);
600 613
601 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct); 614 RenderLayer::mapRectToPaintBackingCoordinates(paintInvalidationContainer, re ct);
602 } 615 }
603 616
604 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer, const PaintInvalidationSta te* paintInvalidationState) 617 LayoutRect RenderLayer::computePaintInvalidationRect(const RenderObject* renderO bject, const RenderLayer* paintInvalidationContainer)
605 { 618 {
606 if (!paintInvalidationContainer->groupedMapping()) 619 if (!paintInvalidationContainer->groupedMapping())
607 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer()); 620 return renderObject->computePaintInvalidationRect(paintInvalidationConta iner->renderer());
608 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer()); 621 LayoutRect rect = renderObject->clippedOverflowRectForPaintInvalidation(pain tInvalidationContainer->renderer());
609 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect, paintInvalidationState); 622 mapRectToPaintInvalidationBacking(paintInvalidationContainer->renderer(), pa intInvalidationContainer->renderer(), rect);
610 return rect; 623 return rect;
611 } 624 }
612 625
613 void RenderLayer::setHasVisibleContent() 626 void RenderLayer::setHasVisibleContent()
614 { 627 {
615 if (m_hasVisibleContent && !m_visibleContentStatusDirty) { 628 if (m_hasVisibleContent && !m_visibleContentStatusDirty) {
616 ASSERT(!parent() || parent()->hasVisibleDescendant()); 629 ASSERT(!parent() || parent()->hasVisibleDescendant());
617 return; 630 return;
618 } 631 }
619 632
(...skipping 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3776 } 3789 }
3777 } 3790 }
3778 3791
3779 void showLayerTree(const WebCore::RenderObject* renderer) 3792 void showLayerTree(const WebCore::RenderObject* renderer)
3780 { 3793 {
3781 if (!renderer) 3794 if (!renderer)
3782 return; 3795 return;
3783 showLayerTree(renderer->enclosingLayer()); 3796 showLayerTree(renderer->enclosingLayer());
3784 } 3797 }
3785 #endif 3798 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.h ('k') | Source/core/rendering/RenderListBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698