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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1804963005: Avoid paintInvalidationContainer parameter of invalidatePaintIfNeeded() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 bool LayoutBox::intersectsVisibleViewport() 1473 bool LayoutBox::intersectsVisibleViewport()
1474 { 1474 {
1475 LayoutRect rect = visualOverflowRect(); 1475 LayoutRect rect = visualOverflowRect();
1476 LayoutView* layoutView = view(); 1476 LayoutView* layoutView = view();
1477 while (layoutView->frame()->ownerLayoutObject()) 1477 while (layoutView->frame()->ownerLayoutObject())
1478 layoutView = layoutView->frame()->ownerLayoutObject()->view(); 1478 layoutView = layoutView->frame()->ownerLayoutObject()->view();
1479 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr); 1479 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr);
1480 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea ()->visibleContentRectDouble())); 1480 return rect.intersects(LayoutRect(layoutView->frameView()->getScrollableArea ()->visibleContentRectDouble()));
1481 } 1481 }
1482 1482
1483 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat e& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContaine r) 1483 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(const PaintInvalidati onState& paintInvalidationState)
1484 { 1484 {
1485 PaintLayer& enclosingSelfPaintingLayer = paintInvalidationState.enclosingSel fPaintingLayer(*this); 1485 PaintLayer& enclosingSelfPaintingLayer = paintInvalidationState.enclosingSel fPaintingLayer(*this);
1486 if (enclosingSelfPaintingLayer.layoutObject() != this) { 1486 if (enclosingSelfPaintingLayer.layoutObject() != this) {
1487 if (isFloating()) 1487 if (isFloating())
1488 enclosingSelfPaintingLayer.setNeedsPaintPhaseFloat(); 1488 enclosingSelfPaintingLayer.setNeedsPaintPhaseFloat();
1489 1489
1490 if (hasBoxDecorationBackground() 1490 if (hasBoxDecorationBackground()
1491 // We also paint overflow controls in background phase. 1491 // We also paint overflow controls in background phase.
1492 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls()) ) 1492 || (hasOverflowClip() && getScrollableArea()->hasOverflowControls()) )
1493 enclosingSelfPaintingLayer.setNeedsPaintPhaseDescendantBlockBackgrou nds(); 1493 enclosingSelfPaintingLayer.setNeedsPaintPhaseDescendantBlockBackgrou nds();
1494 } 1494 }
1495 1495
1496 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason (); 1496 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason ();
1497 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the 1497 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the
1498 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original 1498 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original
1499 // paint invalidation that chose PaintInvalidationDelayedFull. 1499 // paint invalidation that chose PaintInvalidationDelayedFull.
1500 if (fullInvalidationReason == PaintInvalidationDelayedFull) { 1500 if (fullInvalidationReason == PaintInvalidationDelayedFull) {
1501 if (!intersectsVisibleViewport()) 1501 if (!intersectsVisibleViewport())
1502 return PaintInvalidationDelayedFull; 1502 return PaintInvalidationDelayedFull;
1503 1503
1504 // Reset state back to regular full paint invalidation if the object is onscreen. 1504 // Reset state back to regular full paint invalidation if the object is onscreen.
1505 setShouldDoFullPaintInvalidation(PaintInvalidationFull); 1505 setShouldDoFullPaintInvalidation(PaintInvalidationFull);
1506 } 1506 }
1507 1507
1508 PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeed ed(paintInvalidationState, paintInvalidationContainer); 1508 PaintInvalidationReason reason = LayoutBoxModelObject::invalidatePaintIfNeed ed(paintInvalidationState);
1509 1509
1510 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason( reason)) 1510 if (!view()->doingFullPaintInvalidation() && !isFullPaintInvalidationReason( reason))
1511 invalidatePaintForOverflowIfNeeded(); 1511 invalidatePaintForOverflowIfNeeded();
1512 1512
1513 if (PaintLayerScrollableArea* area = getScrollableArea()) 1513 if (PaintLayerScrollableArea* area = getScrollableArea())
1514 area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState, pa intInvalidationContainer); 1514 area->invalidatePaintOfScrollControlsIfNeeded(paintInvalidationState);
1515 1515
1516 // This is for the next invalidatePaintIfNeeded so must be at the end. 1516 // This is for the next invalidatePaintIfNeeded so must be at the end.
1517 savePreviousBoxSizesIfNeeded(); 1517 savePreviousBoxSizesIfNeeded();
1518 return reason; 1518 return reason;
1519 } 1519 }
1520 1520
1521 void LayoutBox::invalidatePaintOfSubtreesIfNeeded(PaintInvalidationState& childP aintInvalidationState) 1521 void LayoutBox::invalidatePaintOfSubtreesIfNeeded(const PaintInvalidationState& childPaintInvalidationState)
1522 { 1522 {
1523 LayoutBoxModelObject::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidati onState); 1523 LayoutBoxModelObject::invalidatePaintOfSubtreesIfNeeded(childPaintInvalidati onState);
1524 1524
1525 if (PaintLayer* layer = this->layer()) { 1525 if (PaintLayer* layer = this->layer()) {
1526 if (PaintLayerReflectionInfo* reflectionInfo = layer->reflectionInfo()) 1526 if (PaintLayerReflectionInfo* reflectionInfo = layer->reflectionInfo())
1527 reflectionInfo->reflection()->invalidateTreeIfNeeded(childPaintInval idationState); 1527 reflectionInfo->reflection()->invalidateTreeIfNeeded(childPaintInval idationState);
1528 } 1528 }
1529 } 1529 }
1530 1530
1531 LayoutRect LayoutBox::overflowClipRect(const LayoutPoint& location, OverlayScrol lbarSizeRelevancy relevancy) const 1531 LayoutRect LayoutBox::overflowClipRect(const LayoutPoint& location, OverlayScrol lbarSizeRelevancy relevancy) const
(...skipping 3190 matching lines...) Expand 10 before | Expand all | Expand 10 after
4722 } 4722 }
4723 4723
4724 void LayoutBox::IntrinsicSizingInfo::transpose() 4724 void LayoutBox::IntrinsicSizingInfo::transpose()
4725 { 4725 {
4726 size = size.transposedSize(); 4726 size = size.transposedSize();
4727 aspectRatio = aspectRatio.transposedSize(); 4727 aspectRatio = aspectRatio.transposedSize();
4728 std::swap(hasWidth, hasHeight); 4728 std::swap(hasWidth, hasHeight);
4729 } 4729 }
4730 4730
4731 } // namespace blink 4731 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698