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

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

Issue 1626623002: Skip PaintPhaseDescendantBlockBackgroundsOnly phase if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@FloatPhase
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.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) 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 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 layoutView = layoutView->frame()->ownerLayoutObject()->view(); 1464 layoutView = layoutView->frame()->ownerLayoutObject()->view();
1465 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr); 1465 mapToVisibleRectInAncestorSpace(layoutView, rect, nullptr);
1466 return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()- >visibleContentRectDouble())); 1466 return rect.intersects(LayoutRect(layoutView->frameView()->scrollableArea()- >visibleContentRectDouble()));
1467 } 1467 }
1468 1468
1469 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat e& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContaine r) 1469 PaintInvalidationReason LayoutBox::invalidatePaintIfNeeded(PaintInvalidationStat e& paintInvalidationState, const LayoutBoxModelObject& paintInvalidationContaine r)
1470 { 1470 {
1471 if (isFloating()) 1471 if (isFloating())
1472 paintInvalidationState.enclosingSelfPaintingLayer(*this).setNeedsPaintPh aseFloat(); 1472 paintInvalidationState.enclosingSelfPaintingLayer(*this).setNeedsPaintPh aseFloat();
1473 1473
1474 if (hasBoxDecorationBackground()
1475 // We also paint overflow controls in background phase.
1476 || (hasOverflowClip() && scrollableArea()->hasOverflowControls())) {
1477 PaintLayer& layer = paintInvalidationState.enclosingSelfPaintingLayer(*t his);
1478 if (layer.layoutObject() != this)
1479 layer.setNeedsPaintPhaseDescendantBlockBackgrounds();
1480 }
1481
1474 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason (); 1482 PaintInvalidationReason fullInvalidationReason = fullPaintInvalidationReason ();
1475 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the 1483 // If the current paint invalidation reason is PaintInvalidationDelayedFull, then this paint invalidation can delayed if the
1476 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original 1484 // LayoutBox in question is not on-screen. The logic to decide whether this is appropriate exists at the site of the original
1477 // paint invalidation that chose PaintInvalidationDelayedFull. 1485 // paint invalidation that chose PaintInvalidationDelayedFull.
1478 if (fullInvalidationReason == PaintInvalidationDelayedFull) { 1486 if (fullInvalidationReason == PaintInvalidationDelayedFull) {
1479 if (!intersectsVisibleViewport()) 1487 if (!intersectsVisibleViewport())
1480 return PaintInvalidationDelayedFull; 1488 return PaintInvalidationDelayedFull;
1481 1489
1482 // Reset state back to regular full paint invalidation if the object is onscreen. 1490 // Reset state back to regular full paint invalidation if the object is onscreen.
1483 setShouldDoFullPaintInvalidation(PaintInvalidationFull); 1491 setShouldDoFullPaintInvalidation(PaintInvalidationFull);
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after
4643 4651
4644 void LayoutBox::clearPercentHeightDescendants() 4652 void LayoutBox::clearPercentHeightDescendants()
4645 { 4653 {
4646 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) { 4654 for (LayoutObject* curr = slowFirstChild(); curr; curr = curr->nextInPreOrde r(this)) {
4647 if (curr->isBox()) 4655 if (curr->isBox())
4648 toLayoutBox(curr)->removeFromPercentHeightContainer(); 4656 toLayoutBox(curr)->removeFromPercentHeightContainer();
4649 } 4657 }
4650 } 4658 }
4651 4659
4652 } // namespace blink 4660 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698