Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 1745 (toElement(node)->compositorMutableProperties() & | 1745 (toElement(node)->compositorMutableProperties() & |
| 1746 (CompositorMutableProperty::kScrollTop | | 1746 (CompositorMutableProperty::kScrollTop | |
| 1747 CompositorMutableProperty::kScrollLeft))) | 1747 CompositorMutableProperty::kScrollLeft))) |
| 1748 return true; | 1748 return true; |
| 1749 | 1749 |
| 1750 if (layer->size().isEmpty()) | 1750 if (layer->size().isEmpty()) |
| 1751 return false; | 1751 return false; |
| 1752 | 1752 |
| 1753 bool needsCompositedScrolling = true; | 1753 bool needsCompositedScrolling = true; |
| 1754 | 1754 |
| 1755 bool hasTranslucentBorder = | |
| 1756 layer->layoutObject() | |
| 1757 ->style() | |
| 1758 ->visitedDependentColor(CSSPropertyBorderLeftColor) | |
| 1759 .hasAlpha() || | |
| 1760 layer->layoutObject() | |
| 1761 ->style() | |
| 1762 ->visitedDependentColor(CSSPropertyBorderRightColor) | |
| 1763 .hasAlpha() || | |
| 1764 layer->layoutObject() | |
| 1765 ->style() | |
| 1766 ->visitedDependentColor(CSSPropertyBorderTopColor) | |
| 1767 .hasAlpha() || | |
| 1768 layer->layoutObject() | |
| 1769 ->style() | |
| 1770 ->visitedDependentColor(CSSPropertyBorderBottomColor) | |
| 1771 .hasAlpha(); | |
| 1755 // TODO(flackr): Allow integer transforms as long as all of the ancestor | 1772 // TODO(flackr): Allow integer transforms as long as all of the ancestor |
| 1756 // transforms are also integer. | 1773 // transforms are also integer. |
| 1757 bool backgroundSupportsLCDText = | 1774 bool backgroundSupportsLCDText = |
| 1758 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && | 1775 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && |
| 1759 layer->layoutObject()->style()->isStackingContext() && | 1776 layer->layoutObject()->style()->isStackingContext() && |
| 1760 layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents && | 1777 layer->backgroundPaintLocation() & BackgroundPaintInScrollingContents && |
| 1761 layer->backgroundIsKnownToBeOpaqueInRect( | 1778 layer->backgroundIsKnownToBeOpaqueInRect( |
| 1762 toLayoutBox(layer->layoutObject())->paddingBoxRect()) && | 1779 toLayoutBox(layer->layoutObject())->paddingBoxRect()) && |
| 1763 !layer->compositesWithTransform() && !layer->compositesWithOpacity(); | 1780 !layer->compositesWithTransform() && !layer->compositesWithOpacity() && |
| 1781 !layer->layoutObject()->style()->boxShadow(); | |
|
bokan
2017/01/17 21:36:55
This looks like it's doing more than just recordin
flackr
2017/01/17 21:59:42
We have this condition in https://cs.chromium.org/
yigu
2017/01/23 18:53:51
Done.
| |
| 1764 | 1782 |
| 1765 if (mode == PaintLayerScrollableArea::ConsiderLCDText && | 1783 if (mode == PaintLayerScrollableArea::ConsiderLCDText && |
| 1766 !layer->compositor()->preferCompositingToLCDTextEnabled() && | 1784 !layer->compositor()->preferCompositingToLCDTextEnabled() && |
| 1767 !backgroundSupportsLCDText) { | 1785 !backgroundSupportsLCDText) { |
| 1768 if (layer->compositesWithOpacity()) { | 1786 if (layer->compositesWithOpacity()) { |
| 1769 addStyleRelatedMainThreadScrollingReasons( | 1787 addStyleRelatedMainThreadScrollingReasons( |
| 1770 MainThreadScrollingReason::kHasOpacityAndLCDText); | 1788 MainThreadScrollingReason::kHasOpacityAndLCDText); |
| 1771 } | 1789 } |
| 1772 if (layer->compositesWithTransform()) { | 1790 if (layer->compositesWithTransform()) { |
| 1773 addStyleRelatedMainThreadScrollingReasons( | 1791 addStyleRelatedMainThreadScrollingReasons( |
| 1774 MainThreadScrollingReason::kHasTransformAndLCDText); | 1792 MainThreadScrollingReason::kHasTransformAndLCDText); |
| 1775 } | 1793 } |
| 1776 if (!layer->backgroundIsKnownToBeOpaqueInRect( | 1794 if (!layer->backgroundIsKnownToBeOpaqueInRect( |
| 1777 toLayoutBox(layer->layoutObject())->paddingBoxRect())) { | 1795 toLayoutBox(layer->layoutObject())->paddingBoxRect())) { |
| 1778 addStyleRelatedMainThreadScrollingReasons( | 1796 addStyleRelatedMainThreadScrollingReasons( |
| 1779 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); | 1797 MainThreadScrollingReason::kBackgroundNotOpaqueInRectAndLCDText); |
| 1780 } | 1798 } |
| 1799 if (layer->layoutBox()->style()->boxShadow()) { | |
| 1800 addStyleRelatedMainThreadScrollingReasons( | |
| 1801 MainThreadScrollingReason::kHasBoxShadowAndLCDText); | |
| 1802 } | |
| 1803 if (!RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && | |
| 1804 hasTranslucentBorder) { | |
| 1805 addStyleRelatedMainThreadScrollingReasons( | |
| 1806 MainThreadScrollingReason::kHasTranslucentBorderAndLCDText); | |
| 1807 } | |
| 1781 needsCompositedScrolling = false; | 1808 needsCompositedScrolling = false; |
| 1782 } | 1809 } |
| 1783 | 1810 |
| 1784 // TODO(schenney) Tests fail if we do not also exclude | 1811 // TODO(schenney) Tests fail if we do not also exclude |
| 1785 // layer->layoutObject()->style()->hasBorderDecoration() (missing background | 1812 // layer->layoutObject()->style()->hasBorderDecoration() (missing background |
| 1786 // behind dashed borders). Resolve this case, or not, and update this check | 1813 // behind dashed borders). Resolve this case, or not, and update this check |
| 1787 // with the results. | 1814 // with the results. |
| 1788 if (layer->layoutObject()->style()->hasBorderRadius()) { | 1815 if (layer->layoutObject()->style()->hasBorderRadius()) { |
| 1789 addStyleRelatedMainThreadScrollingReasons( | 1816 addStyleRelatedMainThreadScrollingReasons( |
| 1790 MainThreadScrollingReason::kHasBorderRadius); | 1817 MainThreadScrollingReason::kHasBorderRadius); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2105 | 2132 |
| 2106 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: | 2133 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: |
| 2107 clampScrollableAreas() { | 2134 clampScrollableAreas() { |
| 2108 for (auto& scrollableArea : *s_needsClamp) | 2135 for (auto& scrollableArea : *s_needsClamp) |
| 2109 scrollableArea->clampScrollOffsetAfterOverflowChange(); | 2136 scrollableArea->clampScrollOffsetAfterOverflowChange(); |
| 2110 delete s_needsClamp; | 2137 delete s_needsClamp; |
| 2111 s_needsClamp = nullptr; | 2138 s_needsClamp = nullptr; |
| 2112 } | 2139 } |
| 2113 | 2140 |
| 2114 } // namespace blink | 2141 } // namespace blink |
| OLD | NEW |