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

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

Issue 1950573003: Improve handling of PaintInvalidationLayer (renamed to PaintInvalidationSubtree) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@LocationChange
Patch Set: Created 4 years, 7 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 3854 matching lines...) Expand 10 before | Expand all | Expand 10 after
3865 { 3865 {
3866 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea()) { 3866 if (PaintLayerScrollableArea* scrollableArea = this->getScrollableArea()) {
3867 if (scrollableArea->hasHorizontalScrollbar() && !scrollableArea->layerFo rHorizontalScrollbar()) 3867 if (scrollableArea->hasHorizontalScrollbar() && !scrollableArea->layerFo rHorizontalScrollbar())
3868 return true; 3868 return true;
3869 if (scrollableArea->hasVerticalScrollbar() && !scrollableArea->layerForV erticalScrollbar()) 3869 if (scrollableArea->hasVerticalScrollbar() && !scrollableArea->layerForV erticalScrollbar())
3870 return true; 3870 return true;
3871 } 3871 }
3872 return false; 3872 return false;
3873 } 3873 }
3874 3874
3875 PaintInvalidationReason LayoutBox::getPaintInvalidationReason(const LayoutBoxMod elObject& paintInvalidationContainer, 3875 PaintInvalidationReason LayoutBox::getPaintInvalidationReason(const PaintInvalid ationState& paintInvalidationState,
3876 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) const 3876 const LayoutRect& oldBounds, const LayoutPoint& oldLocation, const LayoutRec t& newBounds, const LayoutPoint& newLocation) const
3877 { 3877 {
3878 PaintInvalidationReason invalidationReason = LayoutBoxModelObject::getPaintI nvalidationReason(paintInvalidationContainer, oldBounds, oldLocation, newBounds, newLocation); 3878 PaintInvalidationReason invalidationReason = LayoutBoxModelObject::getPaintI nvalidationReason(paintInvalidationState, oldBounds, oldLocation, newBounds, new Location);
3879 if (isFullPaintInvalidationReason(invalidationReason)) 3879 if (isFullPaintInvalidationReason(invalidationReason))
3880 return invalidationReason; 3880 return invalidationReason;
3881 3881
3882 if (isLayoutView()) { 3882 if (isLayoutView()) {
3883 const LayoutView* layoutView = toLayoutView(this); 3883 const LayoutView* layoutView = toLayoutView(this);
3884 // In normal compositing mode, root background doesn't need to be invali dated for 3884 // In normal compositing mode, root background doesn't need to be invali dated for
3885 // box changes, because the background always covers the whole document rect 3885 // box changes, because the background always covers the whole document rect
3886 // and clipping is done by compositor()->m_containerLayer. Also the scro llbars 3886 // and clipping is done by compositor()->m_containerLayer. Also the scro llbars
3887 // are always composited. There are no other box decoration on the Layou tView thus 3887 // are always composited. There are no other box decoration on the Layou tView thus
3888 // we can safely exit here. 3888 // we can safely exit here.
3889 if (layoutView->usesCompositing() && (!document().settings() || !documen t().settings()->rootLayerScrolls())) 3889 if (layoutView->usesCompositing() && (!document().settings() || !documen t().settings()->rootLayerScrolls()))
3890 return invalidationReason; 3890 return invalidationReason;
3891 } 3891 }
3892 3892
3893 // If the transform is not identity or translation, incremental invalidation is not applicable 3893 // If the transform is not identity or translation, incremental invalidation is not applicable
3894 // because the difference between oldBounds and newBounds doesn't cover all area needing invalidation. 3894 // because the difference between oldBounds and newBounds doesn't cover all area needing invalidation.
3895 // FIXME: Should also consider ancestor transforms since paintInvalidationCo ntainer. crbug.com/426111. 3895 // FIXME: Should also consider ancestor transforms since paintInvalidationCo ntainer. crbug.com/426111.
3896 if (invalidationReason == PaintInvalidationIncremental 3896 if (invalidationReason == PaintInvalidationIncremental
3897 && paintInvalidationContainer != this 3897 && paintInvalidationState.paintInvalidationContainer() != this
3898 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti tyOrTranslation()) 3898 && hasLayer() && layer()->transform() && !layer()->transform()->isIdenti tyOrTranslation())
3899 return PaintInvalidationBoundsChange; 3899 return PaintInvalidationBoundsChange;
3900 3900
3901 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()-> maskLayers().thisOrNextLayersUseContentBox() || style()->boxSizing() == BoxSizin gBorderBox) { 3901 if (style()->backgroundLayers().thisOrNextLayersUseContentBox() || style()-> maskLayers().thisOrNextLayersUseContentBox() || style()->boxSizing() == BoxSizin gBorderBox) {
3902 LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousConten tBoxRect : LayoutRect(); 3902 LayoutRect oldContentBoxRect = m_rareData ? m_rareData->m_previousConten tBoxRect : LayoutRect();
3903 LayoutRect newContentBoxRect = contentBoxRect(); 3903 LayoutRect newContentBoxRect = contentBoxRect();
3904 if (oldContentBoxRect != newContentBoxRect) 3904 if (oldContentBoxRect != newContentBoxRect)
3905 return PaintInvalidationContentBoxChange; 3905 return PaintInvalidationContentBoxChange;
3906 } 3906 }
3907 3907
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
4849 if (!flowThread) { 4849 if (!flowThread) {
4850 // If there's no flow thread, we're not nested. All pages have the same height. Give up. 4850 // If there's no flow thread, we're not nested. All pages have the same height. Give up.
4851 return strutToNextPage; 4851 return strutToNextPage;
4852 } 4852 }
4853 // Start searching for a suitable offset at the top of the next page or colu mn. 4853 // Start searching for a suitable offset at the top of the next page or colu mn.
4854 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo gicalTop; 4854 LayoutUnit flowThreadOffset = offsetFromLogicalTopOfFirstPage() + nextPageLo gicalTop;
4855 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo wThreadOffset, contentLogicalHeight) - flowThreadOffset; 4855 return strutToNextPage + flowThread->nextLogicalTopForUnbreakableContent(flo wThreadOffset, contentLogicalHeight) - flowThreadOffset;
4856 } 4856 }
4857 4857
4858 } // namespace blink 4858 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698