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

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

Issue 2346883003: Only paint the background onto the scrolling contents layer if we have a scrolling contents layer. (Closed)
Patch Set: Merge with master Created 4 years, 3 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 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 1479 matching lines...) Expand 10 before | Expand all | Expand 10 after
1490 return false; 1490 return false;
1491 1491
1492 Node* node = layer->enclosingNode(); 1492 Node* node = layer->enclosingNode();
1493 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)))
1494 return true; 1494 return true;
1495 1495
1496 // TODO(schenney): LCD Text also requires integer scroll offsets for the lay er. While we 1496 // TODO(schenney): LCD Text also requires integer scroll offsets for the lay er. While we
1497 // use integer scroll offsets locally when !layer->compositor()->preferCompo sitingToLCDTextEnabled(), 1497 // use integer scroll offsets locally when !layer->compositor()->preferCompo sitingToLCDTextEnabled(),
1498 // we do not check offsets accumulated from the root (including translates). crbug.com/644833 1498 // we do not check offsets accumulated from the root (including translates). crbug.com/644833
1499 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro llersEnabled() 1499 bool backgroundSupportsLCDText = RuntimeEnabledFeatures::compositeOpaqueScro llersEnabled()
1500 && layer->shouldPaintBackgroundOntoScrollingContentsLayer() 1500 && layer->canPaintBackgroundOntoScrollingContentsLayer()
1501 && layer->backgroundIsKnownToBeOpaqueInRect(toLayoutBox(layer->layoutObj ect())->paddingBoxRect()); 1501 && layer->backgroundIsKnownToBeOpaqueInRect(toLayoutBox(layer->layoutObj ect())->paddingBoxRect());
1502 if (mode == PaintLayerScrollableArea::ConsiderLCDText 1502 if (mode == PaintLayerScrollableArea::ConsiderLCDText
1503 && !layer->compositor()->preferCompositingToLCDTextEnabled() 1503 && !layer->compositor()->preferCompositingToLCDTextEnabled()
1504 && !backgroundSupportsLCDText) 1504 && !backgroundSupportsLCDText)
1505 return false; 1505 return false;
1506 1506
1507 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject() ->style()->hasBorderDecoration() 1507 // TODO(schenney) Tests fail if we do not also exclude layer->layoutObject() ->style()->hasBorderDecoration()
1508 // (missing background behind dashed borders). Resolve this case, or not, an d update this check with 1508 // (missing background behind dashed borders). Resolve this case, or not, an d update this check with
1509 // the results. 1509 // the results.
1510 return !(layer->size().isEmpty() 1510 return !(layer->size().isEmpty()
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 1768
1769 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as() 1769 void PaintLayerScrollableArea::DelayScrollPositionClampScope::clampScrollableAre as()
1770 { 1770 {
1771 for (auto& scrollableArea : *s_needsClamp) 1771 for (auto& scrollableArea : *s_needsClamp)
1772 scrollableArea->clampScrollPositionsAfterLayout(); 1772 scrollableArea->clampScrollPositionsAfterLayout();
1773 delete s_needsClamp; 1773 delete s_needsClamp;
1774 s_needsClamp = nullptr; 1774 s_needsClamp = nullptr;
1775 } 1775 }
1776 1776
1777 } // namespace blink 1777 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698