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

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

Powered by Google App Engine
This is Rietveld 408576698