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

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

Issue 2434443005: Only automatically promote scrollers which are untransformed and opaque. (Closed)
Patch Set: Created 4 years, 2 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 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
1677 if (!layer->scrollsOverflow()) 1677 if (!layer->scrollsOverflow())
1678 return false; 1678 return false;
1679 1679
1680 Node* node = layer->enclosingNode(); 1680 Node* node = layer->enclosingNode();
1681 if (node && node->isElementNode() && 1681 if (node && node->isElementNode() &&
1682 (toElement(node)->compositorMutableProperties() & 1682 (toElement(node)->compositorMutableProperties() &
1683 (CompositorMutableProperty::kScrollTop | 1683 (CompositorMutableProperty::kScrollTop |
1684 CompositorMutableProperty::kScrollLeft))) 1684 CompositorMutableProperty::kScrollLeft)))
1685 return true; 1685 return true;
1686 1686
1687 // TODO(schenney): LCD Text also requires integer scroll offsets for the 1687 // TODO(flackr): Allow integer transforms as long as all of the ancestor
1688 // layer. While we use integer scroll offsets locally when 1688 // transforms are also integer.
1689 // !layer->compositor()->preferCompositingToLCDTextEnabled(), we do not check
1690 // offsets accumulated from the root (including translates). crbug.com/644833
1691 bool backgroundSupportsLCDText = 1689 bool backgroundSupportsLCDText =
1692 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() && 1690 RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() &&
1693 layer->canPaintBackgroundOntoScrollingContentsLayer() && 1691 layer->canPaintBackgroundOntoScrollingContentsLayer() &&
1694 layer->backgroundIsKnownToBeOpaqueInRect( 1692 layer->backgroundIsKnownToBeOpaqueInRect(
1695 toLayoutBox(layer->layoutObject())->paddingBoxRect()); 1693 toLayoutBox(layer->layoutObject())->paddingBoxRect()) &&
1694 !layer->transformAncestor() && !layer->transform() &&
1695 !layer->opacityAncestor() &&
1696 !layer->layoutObject()->style()->hasOpacity();
1696 if (mode == PaintLayerScrollableArea::ConsiderLCDText && 1697 if (mode == PaintLayerScrollableArea::ConsiderLCDText &&
1697 !layer->compositor()->preferCompositingToLCDTextEnabled() && 1698 !layer->compositor()->preferCompositingToLCDTextEnabled() &&
1698 !backgroundSupportsLCDText) 1699 !backgroundSupportsLCDText)
1699 return false; 1700 return false;
1700 1701
1701 // TODO(schenney) Tests fail if we do not also exclude 1702 // TODO(schenney) Tests fail if we do not also exclude
1702 // layer->layoutObject()->style()->hasBorderDecoration() (missing background 1703 // layer->layoutObject()->style()->hasBorderDecoration() (missing background
1703 // behind dashed borders). Resolve this case, or not, and update this check 1704 // behind dashed borders). Resolve this case, or not, and update this check
1704 // with the results. 1705 // with the results.
1705 return !(layer->size().isEmpty() || layer->hasDescendantWithClipPath() || 1706 return !(layer->size().isEmpty() || layer->hasDescendantWithClipPath() ||
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1979 1980
1980 void PaintLayerScrollableArea::DelayScrollOffsetClampScope:: 1981 void PaintLayerScrollableArea::DelayScrollOffsetClampScope::
1981 clampScrollableAreas() { 1982 clampScrollableAreas() {
1982 for (auto& scrollableArea : *s_needsClamp) 1983 for (auto& scrollableArea : *s_needsClamp)
1983 scrollableArea->clampScrollOffsetsAfterLayout(); 1984 scrollableArea->clampScrollOffsetsAfterLayout();
1984 delete s_needsClamp; 1985 delete s_needsClamp;
1985 s_needsClamp = nullptr; 1986 s_needsClamp = nullptr;
1986 } 1987 }
1987 1988
1988 } // namespace blink 1989 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698