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

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

Issue 2676333002: Revert "Box shadow should be recorded as main thread scrolling reasons for non-root layers." (Closed)
Patch Set: Keep histograms.xml as is to avoid messing up enum numbers Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * 4 *
5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation.
6 * 6 *
7 * Other contributors: 7 * Other contributors:
8 * Robert O'Callahan <roc+@cs.cmu.edu> 8 * Robert O'Callahan <roc+@cs.cmu.edu>
9 * David Baron <dbaron@fas.harvard.edu> 9 * David Baron <dbaron@fas.harvard.edu>
10 * Christian Biesinger <cbiesinger@gmail.com> 10 * Christian Biesinger <cbiesinger@gmail.com>
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 if (node && node->isElementNode() && 1743 if (node && node->isElementNode() &&
1744 (toElement(node)->compositorMutableProperties() & 1744 (toElement(node)->compositorMutableProperties() &
1745 (CompositorMutableProperty::kScrollTop | 1745 (CompositorMutableProperty::kScrollTop |
1746 CompositorMutableProperty::kScrollLeft))) 1746 CompositorMutableProperty::kScrollLeft)))
1747 return true; 1747 return true;
1748 1748
1749 if (layer->size().isEmpty()) 1749 if (layer->size().isEmpty())
1750 return false; 1750 return false;
1751 1751
1752 bool needsCompositedScrolling = true; 1752 bool needsCompositedScrolling = true;
1753 uint32_t mainThreadScrollingReasons = 0;
1754 1753
1755 // TODO(flackr): Allow integer transforms as long as all of the ancestor 1754 // TODO(flackr): Allow integer transforms as long as all of the ancestor
1756 // transforms are also integer. 1755 // transforms are also integer.
1757 bool backgroundSupportsLCDText = 1756 bool backgroundSupportsLCDText =
1758 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && 1757 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() &&
1759 layer->layoutObject()->style()->isStackingContext() && 1758 layer->layoutObject()->style()->isStackingContext() &&
1760 layer->backgroundPaintLocation(&mainThreadScrollingReasons) & 1759 layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents &&
1761 BackgroundPaintInScrollingContents &&
1762 layer->backgroundIsKnownToBeOpaqueInRect( 1760 layer->backgroundIsKnownToBeOpaqueInRect(
1763 toLayoutBox(layer->layoutObject())->paddingBoxRect()) && 1761 toLayoutBox(layer->layoutObject())->paddingBoxRect()) &&
1764 !layer->compositesWithTransform() && !layer->compositesWithOpacity(); 1762 !layer->compositesWithTransform() && !layer->compositesWithOpacity();
1765 1763
1766 if (mode == PaintLayerScrollableArea::ConsiderLCDText && 1764 if (mode == PaintLayerScrollableArea::ConsiderLCDText &&
1767 !layer->compositor()->preferCompositingToLCDTextEnabled() && 1765 !layer->compositor()->preferCompositingToLCDTextEnabled() &&
1768 !backgroundSupportsLCDText) { 1766 !backgroundSupportsLCDText) {
1769 if (layer->compositesWithOpacity()) { 1767 if (layer->compositesWithOpacity()) {
1770 mainThreadScrollingReasons |= 1768 addStyleRelatedMainThreadScrollingReasons(
1771 MainThreadScrollingReason::kHasOpacityAndLCDText; 1769 MainThreadScrollingReason::kHasOpacityAndLCDText);
1772 } 1770 }
1773 if (layer->compositesWithTransform()) { 1771 if (layer->compositesWithTransform()) {
1774 mainThreadScrollingReasons |= 1772 addStyleRelatedMainThreadScrollingReasons(
1775 MainThreadScrollingReason::kHasTransformAndLCDText; 1773 MainThreadScrollingReason::kHasTransformAndLCDText);
1776 } 1774 }
1777 if (!layer->backgroundIsKnownToBeOpaqueInRect( 1775 if (!layer->backgroundIsKnownToBeOpaqueInRect(
1778 toLayoutBox(layer->layoutObject())->paddingBoxRect())) { 1776 toLayoutBox(layer->layoutObject())->paddingBoxRect())) {
1779 mainThreadScrollingReasons |= 1777 addStyleRelatedMainThreadScrollingReasons(
1780 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText; 1778 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText);
1781 } 1779 }
1782
1783 needsCompositedScrolling = false; 1780 needsCompositedScrolling = false;
1784 } 1781 }
1785 1782
1786 // TODO(schenney) Tests fail if we do not also exclude 1783 // TODO(schenney) Tests fail if we do not also exclude
1787 // layer->layoutObject()->style()->hasBorderDecoration() (missing background 1784 // layer->layoutObject()->style()->hasBorderDecoration() (missing background
1788 // behind dashed borders). Resolve this case, or not, and update this check 1785 // behind dashed borders). Resolve this case, or not, and update this check
1789 // with the results. 1786 // with the results.
1790 if (layer->layoutObject()->style()->hasBorderRadius()) { 1787 if (layer->layoutObject()->style()->hasBorderRadius()) {
1791 mainThreadScrollingReasons |= MainThreadScrollingReason::kHasBorderRadius; 1788 addStyleRelatedMainThreadScrollingReasons(
1789 MainThreadScrollingReason::kHasBorderRadius);
1792 needsCompositedScrolling = false; 1790 needsCompositedScrolling = false;
1793 } 1791 }
1794 if (layer->layoutObject()->hasClip() || layer->hasDescendantWithClipPath() || 1792 if (layer->layoutObject()->hasClip() || layer->hasDescendantWithClipPath() ||
1795 layer->hasAncestorWithClipPath()) { 1793 layer->hasAncestorWithClipPath()) {
1796 mainThreadScrollingReasons |= 1794 addStyleRelatedMainThreadScrollingReasons(
1797 MainThreadScrollingReason::kHasClipRelatedProperty; 1795 MainThreadScrollingReason::kHasClipRelatedProperty);
1798 needsCompositedScrolling = false; 1796 needsCompositedScrolling = false;
1799 } 1797 }
1800
1801 if (mainThreadScrollingReasons) {
1802 addStyleRelatedMainThreadScrollingReasons(mainThreadScrollingReasons);
1803 }
1804
1805 return needsCompositedScrolling; 1798 return needsCompositedScrolling;
1806 } 1799 }
1807 1800
1808 void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons( 1801 void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons(
1809 const uint32_t reasons) { 1802 const uint32_t reason) {
1810 LocalFrame* frame = box().frame(); 1803 LocalFrame* frame = box().frame();
1811 if (!frame) 1804 if (!frame)
1812 return; 1805 return;
1813 FrameView* frameView = frame->view(); 1806 FrameView* frameView = frame->view();
1814 if (!frameView) 1807 if (!frameView)
1815 return; 1808 return;
1816 1809
1817 for (uint32_t reason = 1; 1810 frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true);
1818 reason < 1 << MainThreadScrollingReason::kMainThreadScrollingReasonCount; 1811 m_reasons |= reason;
1819 reason <<= 1) {
1820 if (reasons & reason) {
1821 frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true);
1822 m_reasons |= reason;
1823 }
1824 }
1825 } 1812 }
1826 1813
1827 void PaintLayerScrollableArea::removeStyleRelatedMainThreadScrollingReasons() { 1814 void PaintLayerScrollableArea::removeStyleRelatedMainThreadScrollingReasons() {
1828 LocalFrame* frame = box().frame(); 1815 LocalFrame* frame = box().frame();
1829 if (!frame) 1816 if (!frame)
1830 return; 1817 return;
1831 FrameView* frameView = frame->view(); 1818 FrameView* frameView = frame->view();
1832 if (!frameView) 1819 if (!frameView)
1833 return; 1820 return;
1834 1821
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 2100
2114 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2101 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2115 clampScrollableAreas() { 2102 clampScrollableAreas() {
2116 for (auto& scrollableArea : *s_needsClamp) 2103 for (auto& scrollableArea : *s_needsClamp)
2117 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2104 scrollableArea->clampScrollOffsetAfterOverflowChange();
2118 delete s_needsClamp; 2105 delete s_needsClamp;
2119 s_needsClamp = nullptr; 2106 s_needsClamp = nullptr;
2120 } 2107 }
2121 2108
2122 } // namespace blink 2109 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/web/tests/ScrollingCoordinatorTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698