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

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

Issue 2700613002: Reland recording box shadow as main thread scrolling reason with conflict fixed (Closed)
Patch Set: update test from TEST_F to TEST_P 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 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 if (node && node->isElementNode() && 1745 if (node && node->isElementNode() &&
1746 (toElement(node)->compositorMutableProperties() & 1746 (toElement(node)->compositorMutableProperties() &
1747 (CompositorMutableProperty::kScrollTop | 1747 (CompositorMutableProperty::kScrollTop |
1748 CompositorMutableProperty::kScrollLeft))) 1748 CompositorMutableProperty::kScrollLeft)))
1749 return true; 1749 return true;
1750 1750
1751 if (layer->size().isEmpty()) 1751 if (layer->size().isEmpty())
1752 return false; 1752 return false;
1753 1753
1754 bool needsCompositedScrolling = true; 1754 bool needsCompositedScrolling = true;
1755 uint32_t mainThreadScrollingReasons = 0;
1755 1756
1756 // TODO(flackr): Allow integer transforms as long as all of the ancestor 1757 // TODO(flackr): Allow integer transforms as long as all of the ancestor
1757 // transforms are also integer. 1758 // transforms are also integer.
1758 bool backgroundSupportsLCDText = 1759 bool backgroundSupportsLCDText =
1759 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && 1760 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() &&
1760 layer->layoutObject()->style()->isStackingContext() && 1761 layer->layoutObject()->style()->isStackingContext() &&
1761 layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents && 1762 layer->backgroundPaintLocation(&mainThreadScrollingReasons) &
1763 BackgroundPaintInScrollingContents &&
1762 layer->backgroundIsKnownToBeOpaqueInRect( 1764 layer->backgroundIsKnownToBeOpaqueInRect(
1763 toLayoutBox(layer->layoutObject())->paddingBoxRect()) && 1765 toLayoutBox(layer->layoutObject())->paddingBoxRect()) &&
1764 !layer->compositesWithTransform() && !layer->compositesWithOpacity(); 1766 !layer->compositesWithTransform() && !layer->compositesWithOpacity();
1765 1767
1766 if (mode == PaintLayerScrollableArea::ConsiderLCDText && 1768 if (mode == PaintLayerScrollableArea::ConsiderLCDText &&
1767 !layer->compositor()->preferCompositingToLCDTextEnabled() && 1769 !layer->compositor()->preferCompositingToLCDTextEnabled() &&
1768 !backgroundSupportsLCDText) { 1770 !backgroundSupportsLCDText) {
1769 if (layer->compositesWithOpacity()) { 1771 if (layer->compositesWithOpacity()) {
1770 addStyleRelatedMainThreadScrollingReasons( 1772 mainThreadScrollingReasons |=
1771 MainThreadScrollingReason::kHasOpacityAndLCDText); 1773 MainThreadScrollingReason::kHasOpacityAndLCDText;
1772 } 1774 }
1773 if (layer->compositesWithTransform()) { 1775 if (layer->compositesWithTransform()) {
1774 addStyleRelatedMainThreadScrollingReasons( 1776 mainThreadScrollingReasons |=
1775 MainThreadScrollingReason::kHasTransformAndLCDText); 1777 MainThreadScrollingReason::kHasTransformAndLCDText;
1776 } 1778 }
1777 if (!layer->backgroundIsKnownToBeOpaqueInRect( 1779 if (!layer->backgroundIsKnownToBeOpaqueInRect(
1778 toLayoutBox(layer->layoutObject())->paddingBoxRect())) { 1780 toLayoutBox(layer->layoutObject())->paddingBoxRect())) {
1779 addStyleRelatedMainThreadScrollingReasons( 1781 mainThreadScrollingReasons |=
1780 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); 1782 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText;
1781 } 1783 }
1784
1782 needsCompositedScrolling = false; 1785 needsCompositedScrolling = false;
1783 } 1786 }
1784 1787
1785 // TODO(schenney) Tests fail if we do not also exclude 1788 // TODO(schenney) Tests fail if we do not also exclude
1786 // layer->layoutObject()->style()->hasBorderDecoration() (missing background 1789 // layer->layoutObject()->style()->hasBorderDecoration() (missing background
1787 // behind dashed borders). Resolve this case, or not, and update this check 1790 // behind dashed borders). Resolve this case, or not, and update this check
1788 // with the results. 1791 // with the results.
1789 if (layer->layoutObject()->style()->hasBorderRadius()) { 1792 if (layer->layoutObject()->style()->hasBorderRadius()) {
1790 addStyleRelatedMainThreadScrollingReasons( 1793 mainThreadScrollingReasons |= MainThreadScrollingReason::kHasBorderRadius;
1791 MainThreadScrollingReason::kHasBorderRadius);
1792 needsCompositedScrolling = false; 1794 needsCompositedScrolling = false;
1793 } 1795 }
1794 if (layer->layoutObject()->hasClip() || layer->hasDescendantWithClipPath() || 1796 if (layer->layoutObject()->hasClip() || layer->hasDescendantWithClipPath() ||
1795 layer->hasAncestorWithClipPath()) { 1797 layer->hasAncestorWithClipPath()) {
1796 addStyleRelatedMainThreadScrollingReasons( 1798 mainThreadScrollingReasons |=
1797 MainThreadScrollingReason::kHasClipRelatedProperty); 1799 MainThreadScrollingReason::kHasClipRelatedProperty;
1798 needsCompositedScrolling = false; 1800 needsCompositedScrolling = false;
1799 } 1801 }
1802
1803 if (mainThreadScrollingReasons) {
1804 addStyleRelatedMainThreadScrollingReasons(mainThreadScrollingReasons);
1805 }
1806
1800 return needsCompositedScrolling; 1807 return needsCompositedScrolling;
1801 } 1808 }
1802 1809
1803 void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons( 1810 void PaintLayerScrollableArea::addStyleRelatedMainThreadScrollingReasons(
1804 const uint32_t reason) { 1811 const uint32_t reasons) {
1805 LocalFrame* frame = box().frame(); 1812 LocalFrame* frame = box().frame();
1806 if (!frame) 1813 if (!frame)
1807 return; 1814 return;
1808 FrameView* frameView = frame->view(); 1815 FrameView* frameView = frame->view();
1809 if (!frameView) 1816 if (!frameView)
1810 return; 1817 return;
1811 1818
1812 frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true); 1819 for (uint32_t reason = 1;
1813 m_reasons |= reason; 1820 reason < 1 << MainThreadScrollingReason::kMainThreadScrollingReasonCount;
1821 reason <<= 1) {
1822 if (reasons & reason) {
1823 frameView->adjustStyleRelatedMainThreadScrollingReasons(reason, true);
1824 m_reasons |= reason;
1825 }
1826 }
1814 } 1827 }
1815 1828
1816 void PaintLayerScrollableArea::removeStyleRelatedMainThreadScrollingReasons() { 1829 void PaintLayerScrollableArea::removeStyleRelatedMainThreadScrollingReasons() {
1817 LocalFrame* frame = box().frame(); 1830 LocalFrame* frame = box().frame();
1818 if (!frame) 1831 if (!frame)
1819 return; 1832 return;
1820 FrameView* frameView = frame->view(); 1833 FrameView* frameView = frame->view();
1821 if (!frameView) 1834 if (!frameView)
1822 return; 1835 return;
1823 1836
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2102 2115
2103 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 2116 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
2104 clampScrollableAreas() { 2117 clampScrollableAreas() {
2105 for (auto& scrollableArea : *s_needsClamp) 2118 for (auto& scrollableArea : *s_needsClamp)
2106 scrollableArea->clampScrollOffsetAfterOverflowChange(); 2119 scrollableArea->clampScrollOffsetAfterOverflowChange();
2107 delete s_needsClamp; 2120 delete s_needsClamp;
2108 s_needsClamp = nullptr; 2121 s_needsClamp = nullptr;
2109 } 2122 }
2110 2123
2111 } // namespace blink 2124 } // 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