OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@gmail.com> | 9 * Christian Biesinger <cbiesinger@gmail.com> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 GraphicsLayer* PaintLayerScrollableArea::layerForScrollCorner() const | 214 GraphicsLayer* PaintLayerScrollableArea::layerForScrollCorner() const |
215 { | 215 { |
216 // See crbug.com/343132. | 216 // See crbug.com/343132. |
217 DisableCompositingQueryAsserts disabler; | 217 DisableCompositingQueryAsserts disabler; |
218 | 218 |
219 return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMappin g()->layerForScrollCorner() : 0; | 219 return layer()->hasCompositedLayerMapping() ? layer()->compositedLayerMappin g()->layerForScrollCorner() : 0; |
220 } | 220 } |
221 | 221 |
222 bool PaintLayerScrollableArea::shouldUseIntegerScrollOffset() const | 222 bool PaintLayerScrollableArea::shouldUseIntegerScrollOffset() const |
223 { | 223 { |
224 Frame* frame = box().frame(); | 224 if (m_needsCompositedScrolling) |
225 if (frame->settings() && !frame->settings()->preferCompositingToLCDTextEnabl ed()) | |
226 return true; | 225 return true; |
227 | 226 |
228 return ScrollableArea::shouldUseIntegerScrollOffset(); | 227 return ScrollableArea::shouldUseIntegerScrollOffset(); |
229 } | 228 } |
230 | 229 |
231 bool PaintLayerScrollableArea::isActive() const | 230 bool PaintLayerScrollableArea::isActive() const |
232 { | 231 { |
233 Page* page = box().frame()->page(); | 232 Page* page = box().frame()->page(); |
234 return page && page->focusController().isActive(); | 233 return page && page->focusController().isActive(); |
235 } | 234 } |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1487 | 1486 |
1488 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer) | 1487 static bool layerNeedsCompositedScrolling(PaintLayerScrollableArea::LCDTextMode mode, const PaintLayer* layer) |
1489 { | 1488 { |
1490 if (!layer->scrollsOverflow()) | 1489 if (!layer->scrollsOverflow()) |
1491 return false; | 1490 return false; |
1492 | 1491 |
1493 Node* node = layer->enclosingNode(); | 1492 Node* node = layer->enclosingNode(); |
1494 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k ScrollLeft))) | 1493 if (node && node->isElementNode() && (toElement(node)->compositorMutableProp erties() & (CompositorMutableProperty::kScrollTop | CompositorMutableProperty::k ScrollLeft))) |
1495 return true; | 1494 return true; |
1496 | 1495 |
1497 if (mode == PaintLayerScrollableArea::ConsiderLCDText && !layer->compositor( )->preferCompositingToLCDTextEnabled()) | 1496 if (mode == PaintLayerScrollableArea::ConsiderLCDText |
1497 && !layer->compositor()->preferCompositingToLCDTextEnabled() | |
1498 && (!RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled() | |
1499 || layer->layoutObject()->style()->visitedDependentColor(CSSProperty BackgroundColor).hasAlpha())) | |
1498 return false; | 1500 return false; |
1499 | 1501 |
1500 return !layer->size().isEmpty() | 1502 return !(layer->size().isEmpty() |
1501 && !layer->hasDescendantWithClipPath() | 1503 || layer->hasDescendantWithClipPath() |
1502 && !layer->hasAncestorWithClipPath() | 1504 || layer->hasAncestorWithClipPath() |
1503 && !layer->layoutObject()->style()->hasBorderRadius(); | 1505 || layer->layoutObject()->isFloating() |
1506 || layer->layoutObject()->style()->hasBorderRadius() | |
1507 || layer->layoutObject()->style()->hasBorderDecoration()); | |
flackr
2016/07/27 22:17:27
Why can we not use composited scrolling with a bor
Stephen Chennney
2016/07/28 13:55:38
Dashed borders are broken in tests because we don'
flackr
2016/07/28 14:24:25
Understood, sounds good. Can we land these as a se
Stephen Chennney
2016/07/28 14:50:47
I'm not sure what you mean. Do you mean leave out
flackr
2016/07/28 14:55:15
Yes, basically, we can land these extra conditions
| |
1504 } | 1508 } |
1505 | 1509 |
1506 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) | 1510 void PaintLayerScrollableArea::updateNeedsCompositedScrolling(LCDTextMode mode) |
1507 { | 1511 { |
1508 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer()); | 1512 const bool needsCompositedScrolling = layerNeedsCompositedScrolling(mode, la yer()); |
1509 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { | 1513 if (static_cast<bool>(m_needsCompositedScrolling) != needsCompositedScrollin g) { |
1510 m_needsCompositedScrolling = needsCompositedScrolling; | 1514 m_needsCompositedScrolling = needsCompositedScrolling; |
1511 layer()->didUpdateNeedsCompositedScrolling(); | 1515 layer()->didUpdateNeedsCompositedScrolling(); |
1512 } | 1516 } |
1513 } | 1517 } |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1758 | 1762 |
1759 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() | 1763 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() |
1760 { | 1764 { |
1761 for (auto& scrollableArea : *s_needsClamp) | 1765 for (auto& scrollableArea : *s_needsClamp) |
1762 scrollableArea->clampScrollPositionsAfterLayout(); | 1766 scrollableArea->clampScrollPositionsAfterLayout(); |
1763 delete s_needsClamp; | 1767 delete s_needsClamp; |
1764 s_needsClamp = nullptr; | 1768 s_needsClamp = nullptr; |
1765 } | 1769 } |
1766 | 1770 |
1767 } // namespace blink | 1771 } // namespace blink |
OLD | NEW |