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

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayer.cpp

Issue 1829353004: Rename PaintLayer::mapXXXToPaintBackingCoordinates() to mapXXXInPaintInvalidationContainerToBacking (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 for (PaintLayer* child = firstChild(); child; child = child->nextSibling()) 542 for (PaintLayer* child = firstChild(); child; child = child->nextSibling())
543 child->clearPaginationRecursive(); 543 child->clearPaginationRecursive();
544 } 544 }
545 545
546 LayoutPoint PaintLayer::positionFromPaintInvalidationBacking(const LayoutObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const Pai ntInvalidationState* paintInvalidationState) 546 LayoutPoint PaintLayer::positionFromPaintInvalidationBacking(const LayoutObject* layoutObject, const LayoutBoxModelObject* paintInvalidationContainer, const Pai ntInvalidationState* paintInvalidationState)
547 { 547 {
548 FloatPoint point = layoutObject->localToAncestorPoint(FloatPoint(), paintInv alidationContainer, 0, 0, paintInvalidationState); 548 FloatPoint point = layoutObject->localToAncestorPoint(FloatPoint(), paintInv alidationContainer, 0, 0, paintInvalidationState);
549 549
550 // FIXME: Eventually we are going to unify coordinates in GraphicsLayer spac e. 550 // FIXME: Eventually we are going to unify coordinates in GraphicsLayer spac e.
551 if (paintInvalidationContainer && paintInvalidationContainer->layer()->group edMapping()) 551 if (paintInvalidationContainer && paintInvalidationContainer->layer()->group edMapping())
552 mapPointToPaintBackingCoordinates(paintInvalidationContainer, point); 552 mapPointInPaintInvalidationContainerToBacking(paintInvalidationContainer , point);
553 553
554 return LayoutPoint(point); 554 return LayoutPoint(point);
555 } 555 }
556 556
557 void PaintLayer::mapPointToPaintBackingCoordinates(const LayoutBoxModelObject* p aintInvalidationContainer, FloatPoint& point) 557 void PaintLayer::mapPointInPaintInvalidationContainerToBacking(const LayoutBoxMo delObject* paintInvalidationContainer, FloatPoint& point)
558 { 558 {
559 PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); 559 PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
560 if (!paintInvalidationLayer->groupedMapping()) { 560 if (!paintInvalidationLayer->groupedMapping()) {
561 point.move(paintInvalidationLayer->compositedLayerMapping()->contentOffs etInCompositingLayer()); 561 point.move(paintInvalidationLayer->compositedLayerMapping()->contentOffs etInCompositingLayer());
562 return; 562 return;
563 } 563 }
564 564
565 LayoutBoxModelObject* transformedAncestor = paintInvalidationLayer->enclosin gTransformedAncestor()->layoutObject(); 565 LayoutBoxModelObject* transformedAncestor = paintInvalidationLayer->enclosin gTransformedAncestor()->layoutObject();
566 if (!transformedAncestor) 566 if (!transformedAncestor)
567 return; 567 return;
568 568
569 // |paintInvalidationContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the 569 // |paintInvalidationContainer| may have a local 2D transform on it, so take that into account when mapping into the space of the
570 // transformed ancestor. 570 // transformed ancestor.
571 point = paintInvalidationContainer->localToAncestorPoint(point, transformedA ncestor); 571 point = paintInvalidationContainer->localToAncestorPoint(point, transformedA ncestor);
572 572
573 point.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromT ransformedAncestor()); 573 point.moveBy(-paintInvalidationLayer->groupedMapping()->squashingOffsetFromT ransformedAncestor());
574 } 574 }
575 575
576 void PaintLayer::mapRectToPaintBackingCoordinates(const LayoutBoxModelObject* pa intInvalidationContainer, LayoutRect& rect) 576 void PaintLayer::mapRectInPaintInvalidationContainerToBacking(const LayoutBoxMod elObject* paintInvalidationContainer, LayoutRect& rect)
577 { 577 {
578 PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer(); 578 PaintLayer* paintInvalidationLayer = paintInvalidationContainer->layer();
579 if (!paintInvalidationLayer->groupedMapping()) { 579 if (!paintInvalidationLayer->groupedMapping()) {
580 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer()); 580 rect.move(paintInvalidationLayer->compositedLayerMapping()->contentOffse tInCompositingLayer());
581 return; 581 return;
582 } 582 }
583 583
584 LayoutBoxModelObject* transformedAncestor = paintInvalidationLayer->enclosin gTransformedAncestor()->layoutObject(); 584 LayoutBoxModelObject* transformedAncestor = paintInvalidationLayer->enclosin gTransformedAncestor()->layoutObject();
585 if (!transformedAncestor) 585 if (!transformedAncestor)
586 return; 586 return;
(...skipping 11 matching lines...) Expand all
598 layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer , rect, paintInvalidationState); 598 layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer , rect, paintInvalidationState);
599 return; 599 return;
600 } 600 }
601 601
602 // This code adjusts the paint invalidation rectangle to be in the space of the transformed ancestor of the grouped (i.e. squashed) 602 // This code adjusts the paint invalidation rectangle to be in the space of the transformed ancestor of the grouped (i.e. squashed)
603 // layer. This is because all layers that squash together need to issue pain t invalidations w.r.t. a single container that is 603 // layer. This is because all layers that squash together need to issue pain t invalidations w.r.t. a single container that is
604 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc. 604 // an ancestor of all of them, in order to properly take into account any lo cal transforms etc.
605 // FIXME: remove this special-case code that works around the paint invalida tion code structure. 605 // FIXME: remove this special-case code that works around the paint invalida tion code structure.
606 layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer, re ct, paintInvalidationState); 606 layoutObject->mapToVisibleRectInAncestorSpace(paintInvalidationContainer, re ct, paintInvalidationState);
607 607
608 mapRectToPaintBackingCoordinates(paintInvalidationContainer, rect); 608 mapRectInPaintInvalidationContainerToBacking(paintInvalidationContainer, rec t);
609 } 609 }
610 610
611 LayoutRect PaintLayer::computePaintInvalidationRect(const LayoutObject& layoutOb ject, const PaintLayer* paintInvalidationContainer, const PaintInvalidationState * paintInvalidationState) 611 LayoutRect PaintLayer::computePaintInvalidationRect(const LayoutObject& layoutOb ject, const PaintLayer* paintInvalidationContainer, const PaintInvalidationState * paintInvalidationState)
612 { 612 {
613 if (!paintInvalidationContainer->groupedMapping()) 613 if (!paintInvalidationContainer->groupedMapping())
614 return layoutObject.computePaintInvalidationRect(*paintInvalidationConta iner->layoutObject(), paintInvalidationState); 614 return layoutObject.computePaintInvalidationRect(*paintInvalidationConta iner->layoutObject(), paintInvalidationState);
615 615
616 LayoutRect rect = layoutObject.clippedOverflowRectForPaintInvalidation(paint InvalidationContainer->layoutObject(), paintInvalidationState); 616 LayoutRect rect = layoutObject.clippedOverflowRectForPaintInvalidation(paint InvalidationContainer->layoutObject(), paintInvalidationState);
617 mapRectToPaintBackingCoordinates(paintInvalidationContainer->layoutObject(), rect); 617 mapRectInPaintInvalidationContainerToBacking(paintInvalidationContainer->lay outObject(), rect);
618 return rect; 618 return rect;
619 } 619 }
620 620
621 void PaintLayer::dirtyVisibleContentStatus() 621 void PaintLayer::dirtyVisibleContentStatus()
622 { 622 {
623 compositor()->setNeedsUpdateDescendantDependentFlags(); 623 compositor()->setNeedsUpdateDescendantDependentFlags();
624 m_visibleContentStatusDirty = true; 624 m_visibleContentStatusDirty = true;
625 if (parent()) 625 if (parent())
626 parent()->dirtyAncestorChainVisibleDescendantStatus(); 626 parent()->dirtyAncestorChainVisibleDescendantStatus();
627 // Non-self-painting layers paint into their ancestor layer, and count as pa rt of the "visible contents" of the parent, so we need to dirty it. 627 // Non-self-painting layers paint into their ancestor layer, and count as pa rt of the "visible contents" of the parent, so we need to dirty it.
(...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2835 2835
2836 void showLayerTree(const blink::LayoutObject* layoutObject) 2836 void showLayerTree(const blink::LayoutObject* layoutObject)
2837 { 2837 {
2838 if (!layoutObject) { 2838 if (!layoutObject) {
2839 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2839 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2840 return; 2840 return;
2841 } 2841 }
2842 showLayerTree(layoutObject->enclosingLayer()); 2842 showLayerTree(layoutObject->enclosingLayer());
2843 } 2843 }
2844 #endif 2844 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.h ('k') | third_party/WebKit/Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698